How to safely unplug an outdoor extension cord that got wet?
If the outdoor socket has gfci protection through another (indoor) outlet then you can turn that gfci outlet off.

If you know which circuit the outlet is on you can turn off just that breaker.

The nuclear option is to go to the main breaker and shut that off.

After the power is shut off you can safely unplug the extension cord and then turn the chosen shutoff back on.