So I just bought a Squier classic vibe 50's electric guitar like earlier today and have been playing it for a while. Then I went to put it away and caught my jumper on the top of the strings where a little bit was sticking out of the peg and ripped the whole string out! The third is completely out and the bottom one is very loose.

What the hell do I do?! I've played acoustic for years and never broke a string, I can't believe within hours of getting electric i break one

Just to add, the guitar was bought second hand with minimal to no use before sal
I would just change out all the strings. If you don't know how here's 2 videos. One is for changing the strings and the other is for setting up the guitar. I'm guessing this is a start so when you get new strings try to keep the same gauge strings on it if you don't want to mess with the trem. Or you could just block the trem.
ESP E-II Horizon FR
Gibson Flying V HET SET
ESP Eclipse II FM JB/Jazz
ESP M-II Deluxe EMG 81/SA
Marshall JCM2000 DSL/ JCM800 1960a cab
Tama Drums/ Sabian