Go to settings and search lid and then click on what happens when the lid is closed then change that instead of sleep or power off change it to "Do Nothing" then when your laptop wont go to sleep and will instead keep on using power and stay turned on.
Warning:Change the settings back afterwards