The idea is that a nuke would be first used to take out an entire invading army, not civilians. But the deterrent is knowing that it would result in nukes being launched against the civilian population, that would then result in the tit-for-tat escalation of using nukes.
If nuclear weapons were so effective, then why didn’t Putin just drop one on Kiev and call for surrender?
Why is he killing his own troops now when one bomb would have done the trick?