A few days ago I wanted to download some kind of free Minecraft. My computer started to act weird. Sometimes it would crash after 30 minutes?

I went into safe mode and tried the system restore. But it kept showing these lines on the login screen. Then when I logged in, my computer screen would go black, and I couldn t do anything. Please help me. And I'm quite embarrassed to tell this but I really need help.

It's probably infected with a virus of some sort. You need to run an anitvirus and scan your system. Try Malwarebytes. Also look for any programs that have installed that you didn't install. If it bombs out within 30minutes you need to be quick. Do not connect and devices to the PC as they'll be infected too. And next time you see something for free that usually isn't don't follow it or try to download it. It's a scam.

I would transfer my data to other drives and reinstall the windows, a fresh one as restoring doesn't help.

There's no "free" minecraft
its most likely an infected version of the game
worst case you lose everything on the computer
best case you reinstall your OS (since you said you can't do anything)