Now of course, you don't know how to do these things yet.
In your city screen, you 3 bars where commerce is devided in tax, gold and luxury.
If you press F1, you see at the top of the screen 2 bars that alow you to set percentages how you want to share the income in your cities. Only 2 bars, every % that is no assigned to those 2 bars automatically goes to gold.
Every commerce that ends up in luxury this way will make a citizen happy.
This is nation wide however, but the most efficient way to make your people happy. Sometimes one city requires a lot more luxuries than another. If you do this with the slider, you would be wasting lots of commerce in your other cities only to keep 1 city happy.
Therefore, you can use clowns. In a city, take one worker from his work and you will get a specialist. Click on the specialist's face and you will cycle trough the options taxman, scientist and clown.
Use these minimaly however. Using specialists slows down your city growth considerably or even stops it completely. So it is not good for the future. Try never having more than 1 or 2 clowns in your whole empire.
The best way to keep your people happy however is connecting or trading luxury resources like whines, incense etc... Look in the civilopedia to see what they look like. This gives you an extra happy guy in every city that is connected to it.
Marketplaces enhance the benefit from these resources when you have 3 or more of them.
Finaly there are the happiness buildings like temples, coloseums etc. But because these buildings cost as much upkeep as they make people happy, i strongly advise you not to build these for happiness reasons. Only build them when you need the culture (border expansion) or when you go for a cultural victory.
Oh yes, some government forms allow the use of militairy police. Every militairy unit up to the given number for that government makes 1 unhappy person happy. In despotism, your starting government 2 units per city can be used this way. The same goes as for the buildings though, if you have units for other reasons use them for this, but do not build them for this reason alone.
In your city, you see your citizens faces.
whenever there are less happy faces than unhappy faces, the city will riot. Content faces are "neutral".
Whenever an unhappy situation occurs, you get one turn to do something about it. So the turn your city grows, you get the unhappy guy because it is too crowded, but they will not riot that same turn. They start to riot next turn.
So you need to check every turn to prevent riots from happening.
You can also do this in the F1 screen where you see the population from all your cities without going to each city seperatly.
Later in the game, if you are doing very well and became rich enough to afford it, you could insert a little safety buffer by putting the lux slider a little higher than actually needed. Then you could check every 5 turns or so. This wastes a lot of money though, so it should only be done when you are already in a good winning position.