Which Sata? There's 2 cables in the back of any drive. The Sata data cable and the Sata power cable.
As mentioned, Sata drives are designed to be plugged in/out with the pc on, that's hot-swappable and is activated in bios to allow such for that data port, If you first undock the drive.
Messing with a Sata data cable only affects the data, can corrupt it, doesn't matter hdd or ssd, it's not going to physically harm the drive.
Messing with the Sata power connector is different. That's a physical reaction and can hurt drives if they are currently in use.
Either which way, there's only one major mistake made, you should Not have sticky fingers inside a pc while it is running, period. The psu and motherboard both have lethal electrical power components and touching the wrong component or applying a dead short between that component and ground (electro-static wrist strap) can make for a very bad day.
A defibrillator is first charged to 200 joules. That's the machine used by medics to kick-start a heart. A joule is 1w/time in seconds. A psu is capable of 550w ish or 850w ish. You ground out across the 12v discharge and you'll hit a 550 joule spike across your heart in a second. That's Killing power.
Keep hands out of running pc's and you'll never need worry about drives going bunk by touching Sata cables.