Laptop freeze with black screen

I have a Lenovo Ideapad 520.I have ran into a serious problem with it lately. So, I have had this issue everytime I open a game and play for a while, and then my computer gives me a continuous clicking sound(I think its from fan) and laptop says its not plugged in , and after 1 minute the laptop becomes unresponsible and freeze with black screen. I reboot the laptop with power button and it boots as if no error happened to it. The problem can happen in the first 1 minutes of playing or it could go on till the end of the day. I run the game at the lowest settings and yet this still happens. It only started to happen a 1 week ago. Could this be a power supply problem? I am certain this isn't an overheating problem as after my laptop shut down, I tried to check if it was heated, and it was barely even warm.

My Specs:

Processor: Intel Core i7 8550U quad core
RAM: 8 Gb
Windows 10 latest build
Ssd : 1tb
Graphics card: nvidia MX150

I am also certain this isnt a virus issue.since I scanned it with malwarebytes anti rootkit and with avast and nothing detected. Please provide a solution or tell me what the problem here is. Thanks.

Also if I unplug the AC adapter as soon as the clicking sound starts the clicking sound goes away and laptop runs fine at battery.

My games are (Among us,Minecraft , GTA 5 , and Fortnite)
this problem also occurs when I use chrome