Against the AI, I would recommend putting a melee unit there, and leaving a ranged unit behind it. The enemy units will usually not even attempt to attack the fortified units and will try to walk around, allowing you to bombard them with impunity (and they can only move one tile per turn if you place the fort in a good location, which forces them to walk right next to it).
In addition I recommend using a melee unit that receives tile defensive bonus and that can fortify, such as a rifleman. That means 50% for fortification + 50/100% for fort/citadel.
I'm guessing human opponents might be smarter and just constantly bombard the fortified melee unit, but you can usually still hold a few turns - I suggest, in these cases, to have a backup melee unit ready to replace the wounded one.
I've used forts and citadels in the above way to successfully defend against basically unlimited number of enemy AI troops - especially when I was able to have two siege units behind my fortified one. Just be wary of later-era units that can out-range this entire formation, such as artillery and aircraft.