as for ram I have tried it once and it freeze the pc, I forgot if I have another plugged in or not though.
Typically on hot swappable devices it’s been common to make the ground pins a little longer than the rest, ensuring that those will make contact first. The issue with hot swappable devices aside from a sharp initial draw is “grounding” the circuit to an IO pin before real ground is made. Most default low potential IO pins won’t enjoy taking the full load of the device while the ground plane is missing connection.
Oddly to me, many new PC BIOS ship with SATA hot swapping disabled. IDK why. You can plug the drive in it’ll spin up, but no data transfer will happen until you reboot. Safe, just ineffective. I recently had to learn this the hard way.
I think this is something the OS can override. If I remember correctly I could discover a hotplugged SATA device in Windows by using "Scan for new hardware" in the Device Manager.
That is to say, if hotplugging is disabled on your SATA controller, then the firmware won't see a new SATA drive if you plug it in while the machine is running. So, for example, you won't get a UEFI boot menu entry for it if you go to the boot override section that presents all of your storage devices.
Once the operating system takes over, that's all a moot point. Whether hot-plugging was disabled in your firmware settings or not, if the OS supports it, it will work. Both Microsoft's AHCI driver (msahci.sys) and the Linux "ahci" kernel module (or built-in) support hot-plugging.
On my Windows desktop with an Intel SATA chipset, hot-plugging a drive did cause Windows to briefly drop all other drives on that controller before re-enumerating all of them, which lead to a BSoD because one of those drives was the drive with Windows itself on it. However, this was solved by installing Intel's chipset-specific driver (Intel Rapid Storage Technology, iaStorV.sys) and tweaking the registry to have that one start at early boot instead of msahci.
You'd be surprised at all the stuff you can get away with on a live computer. For example, did you know that AHCI (SATA) and PCIe (and thus NVMe) are both hot-pluggable and hot-swappable? ... and that you can hotswap RAM (with a cooperating motherboard and OS) and even CPUs (on multi-socket boards)?