1) Building units too fast for your economy? Buildings also have maintenance, so only build what you need.How can I stop losing gold through the entire game on King difficulty?
It doesn't make any sense to me, one turn it's plus 20, the next it's negative 20...
The only time I stay in the black is if I win a war in the first half of the game and build a lot of trading posts on a lot of enemy real estate.
If I keep getting harassed by the ai early on and can't take any extra cities then I usually have to quit due to gold loss & therefore lagging so far behind on science.
2) Taking new cities mean new upkeep cost for the buildings on that new city, could explain your -20 gold all of a sudden.
3) Your best sources of income are trade routes and internal trades through city connections (roads or harbors), don't neglect those.
4) Only connect cities through road once they reach a population equal to the number of roads you'd have to build. Each road costs 1 gold. So for exemple your secondary city is tiles from your capital, wait for it to be size 6 before connecting a road. Else you will be losing money for a long time.
5) Remember to sell you extra luxuries for 7 gold a turn or 240 gold to friends. Sell also strategic ressources you don't need (iron, horses, etc).
6) Sea trade routes give twice the money compared to land trade routes. Best is to have all trades from one city and prioritise all economic buildings, markets etc to make it count.
Good luck.