The blue screen can be a software problem such as BIOS settings and drivers, or it can be a hardware problem.
First, you should replace the RAM and hard drive and make sure of their health.
If the CPU is replaceable, it can also be a problem.
If the above does not solve the problem, you should disconnect all accessories such as keyboard, Wi-Fi, etc. and see if the problem is on the motherboard or somewhere else.
If the problem was on the motherboard and the BIOS was OK, you should check the graphics-sound-network and IC charging ,etc.