Why does my laptop keep shutting down automatic without a reason in any moment

Hi,

It's probably overheating and it's damaging the motherboard.
Remove dust from the fan and if the problem persist, you might have to reapply thermal paste on the CPU.
Also some laptop has faulty GPU.

Might want to test in safemode and try scanning for malware with malwarebyte, adwcleaner and roguekiller.