In your power settings there should be an option “choose what closing the lid does” or something like that, and you can change it to do what you’d like.
Not sure what os you have but on windows you can just right-click your battery icon in the task bar and choose power options from there. Linux has something similar but I don’t recall where exactly.