Heat is almost always the root cause. So, monitor the temperature.
Use HWiNFO64 (free) to monitor GPU temperature while gaming — if it's hitting 85°C+, that's your problem
Elevate the back of the laptop or use a cooling pad under the base
Clean the vents with compressed air — the base vents clog easily
In Start Search type Regedit and hit ok
Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers
Right-click → New → DWORD (32-bit) → name it TdrDelay
Set value to 8 (decimal)
Reboot
Open Device Manager → Display Adapters → GTX 1050 → Properties
Go to Driver tab → check driver version
In NVIDIA Control Panel → Manage 3D Settings → Power Management Mode → set to "Prefer Maximum Performance"
Download DDU (Display Driver Uninstaller)
Boot into Safe Mode, run DDU, select NVIDIA, Clean and Restart
Install the latest NVIDIA driver manually