yturk39's idea is a very good one. Two turns or so before a unit is completed use the control key to queue up a different type of unit to be produced - this will stop production of the previous unit and you will not have to pay support for it until it is completed. You'll have to micro manage your production queues. (I suggest defensive type units, archer, spear man if your neighbors have horsemen -because, believe me, you will be defending with them very soon). This can stave off abject poverty for a few turns while you research a tech that will not cost you support money (allows you to construct a building rather than a unit).
If you are researching a tech that *won't* help you out of this situation, it's time to change your research path. Click on the beaker at the top of the screen and select a better (building enabling) research option. You won't lose your progress on the other research and you can go back and complete it when you are out of your money trouble/are able to build buildings instead of units you have to support.
How does one get into this predicament? My experience is that it happens when you try for too rapid expansion in relation to research early in the game. I've been there a couple of times, and watched the game move my research slider down to zero then, in the worst case scenario, start to disband my units to keep me from going into the red.
If that looks like it's going to happen it's better to eliminate units of your choice before the game makes that choice for you. You will end up with only one unit per city before the game gets done with you. I believe it is set up to kill off your workers first, then units that are not directly in a city tile. It's brutal.
Even better yet, don't get into that situation. Sometimes it's much better to burn a captured city or three than to overextend yourself. Quality over quantity. Once you have to start eliminating military units to remain in the black your neighbors will come calling.
Once your neighbors start capturing your vulnerable cities, you will become free of their support costs and may find yourself back in the black in your remaining cities, so having those almost completed units in your queue that yturk39 suggested can be just the thing you need to fend off the assault and survive to fight another day.
Anyway, that's my 2¢ worth. I'm not sure it's worth that much, so today it's totally free. Good luck!