Specialist in Civ 7 is a double-edged sword. Watch out for them
While a key mechanic, Specialists in Civ 7 are not very important in the first age. Nevertheless, they become more and more useful in time. However, there are no roses without thorns.

If you want to win Sid Meier’s Civilization 7, you need to build settlements. While armies are useful, you will not be able to use them, if your economy is not good enough. So, founding new towns is a way to go. Of course, they can grow or even evolve into cities. Thanks to that they become bigger and produce more resources. Growth is also connected to Specialists. They are civilians who can upgrade your districts even more, but they have some disadvantages.
How to get Specialists in Civ 7
Specialists become more important in the second age. Why is that so? Science Legacy Path forces you to place them. So, how to get them?

Expand your city or place a Specialist.Source: Sid Meier's Civilization VII, Developer: Firaxis Games
Specialists can be placed only in cities, not towns.
When your city grows, you can expand its borders. It is depicted by green hue. Thanks to that you gather resources from the neighboring tiles or build structures on them. However, instead of that, it is possible to invest these precious points in Urban Districts (with a building). Proper places are colored blue. This way you create a Specialist. Easy as that. However, while they are quite useful, do not place too many of them.
Specialists in Civ 7 are a double-edged sword
So, why should you watch out? While Specialists significantly boost your Science and Culture, they also reduce your Food and Happiness gain. Food is necessary for settlements to grow. While low Happiness is a highway to rebellion. Moreover, remember that at the end of the age, there are crises which will lower resident satisfaction even further.
More:Civilization 7 Guide