Something I don't understand about AC electricity

  1. the situation i mentioned was different, accidental. you put your finger where it didn’t belong and you touched a contact/wire at a high voltage (high enough to cause a painful shock).

2)those power transformers might be used on other devices if done correctly. you need to match the voltage and current provided, the polarity and plug type. do it incorrectly and you might wreck your electronic device.

In countries where polarity isn’t enforced like those the use Schuko or Italian plugs, how do you safely replace a bulb in a table lamp since there’s a 50% chance of the shell being hot? I assume both lines are switched and you make sure a lamp is switched off before changing the bulb? Or are you just really careful?

What do you mean by shell? If you mean the body of the lamp fixture itself, that shouldn’t be part of the circuit in a sanely designed, non-malfunctioning lamp. As far as the bulb goes, glass is an insulator, so even if the polarity is reversed, the only part of the bulb that will be hot is the metal threading at the base. So you have to be careful not to touch the metal base until the bulb is all the way out of the socket. Or, since it’s a table lamp, just unplug it before you change the bulb. That’s probably the safest course of action.