You must have first a goal. For example, playing Morocco, you want to rush science, because your early game sucks. This means you are going to focus your buildings in science.
Then you need to know your surroundings. If you cannot place many cities and you have some good food area, then can play tall, meaning specialists. If your civ is going to have specialists, then, given the choice, build first the building with a specialist slot. (Make sure you can keep the growth). In this case, it's the library. If you can expand fairly well, and play wide, then you are going progress, meaning well developed cities, but little population, so the bulk of your yields is going to come from buildings. Given the choice, go first for buildings with higher yield output, usually the one without a specialist slot (amphitheater before writer guild, for example).
Also you need to set priorities for short/long term. For long term, going production, then gold, mixed with growth is the way to have all your buildings built in time. But for short term, you might need a barracks built right now, or an extra horseman, to help for an incoming fight. You must be prepared, for AI will attack you if they smell your weakness. Check once in a while how strong is your army, compared to your neighbours, and how aggressive their personalities are.
And finally, if your happiness is too low (under -10), then you might need to build something the helps making your people happy again. If crime is 4 and you haven't build a wall in the city, then it's about time. Temples help with religious divisions. You get the idea.