The money is (except your army and advanced science) one of the most powerful tools you have at your disposal. That's why you should do everything possible to have enough of it. Like in real life, it isn't an easy thing.
The main tool of control where our commerce goes is the global slider. Commerce is used in three main regions: Research (science), Gold (income) and Culture. Usually the most commerce goes into Research - because the technological advancements are most important, but some part always goes also into remaining two areas - culture and income.
How to earn money?
Holy City and Shrine - predictable and stable source of income. What is very important, if we have a Shrine of faith that is not our state religion we loose the line of sight but receive the cash. It's possible to have, i.e. three Shrines and all of them will generate nice amounts of money;
Merchants (specialists) and buildings increasing a Gold output - Marketplace, Grocer, Bank and Wall Street;
Great Merchant and trade mission - One-time but huge pile of Gold;
Build a lot of cottages and make them grow into towns, research printing press, choose free market and free speech and maximize number of international trade routes.
How you loose it?
Civics - every civic has an upkeep cost: none, low, medium and high - the exact amounts of Gold are dependant on civilization size - the bigger nation and more expensive civics - the higher costs goes;
Army - some of the units are free but most of them need money to exist. Additionally you pay much more when going to war - support costs depends on how big army is and on what terrain (within enemy border is most expensive) military units fight;
City maintenance - you pay for the cities not buildings. Costs are dependant on distance from capital (or other government centres - like Forbidden Palace or Versailles) and overall number of cities;
Inflation - some amounts of money which you are loosing every turn. Not a very significant one - but quite annoying.