So i was building a project of mine with a raspberry pi and a relay (https://www.faranux.com/product/single- ... ule-com41/) when i attached the 5v to the 5v and the ground to ground and the IN to GPIO 4 i got it working once. When i tried again the relay would just turn on immediately and will only turn off when i disconnect the GPIO pin. I then tried it on another pi to check if the relay was the problem and then that pi's gpio pins also stopped working. So i think i just screwed up 2 of my raspberry pi's

But can anyone double check why it stopped working and what i did wrong, i'm not a very electrical guy i just know the basics so i didnt think connecting a 5v relay to a 5v port on the pi and then just turning it on and off once could screw up my pi but i have a feeling i just wasted about 100$ by screwing around with this relay (im stupid i know).
Next question is: can i still use the pi when the GPIO ports are fried or should i throw it away? because the pi itself is still working and can run programs but the GPIO is just fried i guess.