I agree with Secespitus, but I fear he left something out.
Diversity isn't shoehorning people in (he correctly points out this is Tokenism, and in its most invasive and poisonous forms), it's showing that there is more to the world than (for example in Western literature) straight white males.
But this has to arise naturally. If you're setting your story in 19th century America, in the well-to-do circles, then odds are you won't encounter many black people (and if you do they are in supporting roles at best).
Edit, for clarification on roles of black people in 19th century America.
While it is true that, depending on where in America, you will be almost surrounded by black people, 'presence' and 'spotlight' are not and should not be conflated. For example. If the scene (or story) is set on a plantation in the south, then not writing in at least a black person is ridiculous. But you then face the strict ethical and social norms of the day.
Meaning. Black people on plantations in the south of the US at the time, worked the land. This is 'different' from slavery, in that they were paid to do so, but were tricked into essentially working for so little that nothing ever changed. Some were still kept on as 'house servants', but really the divide isn't likely to have been much different from slavery days, and treatment hadn't improved.
So, what I am trying to say, is that the social norms between whites and blacks of the time will not have drastically improved from the days of slavery. This is why lynchings and racial segregation were so ubiquitous of the time.
I, in no way, shape, or form, wish to portray this as right (in the sense that it is how it should be or should have been done). But as far as I am aware, the above description is factually accurate.
The thing is, and this is where people often stray into the mist, they are there. They exist in the world, and people know about them (even in 1st century Europe, people were well aware of people with different skin colour because of slave trade coming in from the middle east, and especially because of Rome conquering so much of the then known world.
The best people can ask is why you would set the story in a setting with a monolithic culture, but fact is these niches do exist.
What needs to be said is that no matter the setting, the situation, the location, diversity is always present. It's just that in some settings they would be more underground.
Examples. Racial minorities I've already covered above. So how about mental illness? Even in a time before the current diagnosis exists, the illness was still there, they just called it something else.
Schizophrenia (hearing voices, for example) was considered possession by demons or signs of witchcraft. They were often burned at the stake for this.
Porphyria (sensitivity to sunlight for medical reasons) was linked to vampirism, because the person seemed to 'burn' in sunlight.
Redheads were thought to turn into vampires upon death (and were also often considered witches and also burned at the stake).
Hairy people were considered to be werewolves, though curiously mostly women were killed in werewolf trials.
Homosexuality (bisexuality, etc) was considered differently in different cultures, but mainstream Western civilization lived by Judaeo-Christian standards, and therefore it was punishable by death more often than not. Especially under Imperial (English) rule. But there are many that were gay, and people knew about it just the same. They were part of the discourse, even if scorned for it.
Trans people have been around too, though not readily understood and often conflated with 'gay', even back then. Less talked about, and again conflated with gay culture for much of history.
So, my point, is that even if you don't explicitly say they are different, understand there will always be outliers in every setting. There's no such thing as a monolithic homogeneous culture. Some agree, some don't. Some fit in, some don't. It's the way of the world.
Diversity, in its purest form, simply acknowledges this and sees people for how they are: diverse.
Even in a setting with Caucasians, you will get some racists, some who are anti-racism, and most who just aren't invested enough to care. You will get some effeminate males, and some masculine females. And you will get a fringe culture within the totality. That's how human beings were, are, and always will be.