Hello, my name is Mario, and I would be happy to assist you with your issue.
I’m sorry for what happened!
Press Win + S and type "Control Panel", then open the Control Panel.
Go to Hardware and Sound > Power Options.
In the left-hand menu, click "Choose what closing the lid does."
Under "When I close the lid":
Set it to "Do nothing" (for both On battery and Plugged in).
Click Save changes.
Best regards,
Mario B.