I do not attack a city if its defenders can kill one of my units in a single round. If they can do that, I either sue for peace until I am stronger, or I sit on the outskirts sniping off their defenders until I have enough units with enough promotions to take them out. If it takes 100 turns that's OK so long as my units aren't dying -- they are leveling up with good promotions that will eventually get the job done (i.e., by getting range promotion say).
I might be willing to sacrifice 1-2 units in the last round of combat when the city goes down, if it is a capital. In that case I try and offer a sacrifice, some low promoted unit to soak up damage.
I cringe if a high promoted unit dies, I figure that should never happen. Whenever it does, I try and think about what was the mistake I made.