To avoid data corruption or SD card damage, you should never just unplug the power from a Raspberry Pi. Instead, use one of these safe methods:
1. Shut Down via Command Line (SSH/Terminal)
A. Immediate Shutdown
bash
sudo shutdown -h now
-h = Halt ...