The only things you can control on this laptop are the drive, memory, and OS.
Is the laptop using a hard drive or an SSD? Not all SSDs are compatible with older Macs.
Does this laptop have the original Apple memory or a third party memory upgrade? If the latter, what is the make & model of the memory? Macs are very picky about the memory they use.
Is this a 15" or 17" model? If so, then you may have a GPU failure which is common with the 15" & 17" models.
Which version of macOS are you installing? If you are installing OSX 10.6 Snow Leopard, then install it from the retail DVD (not the gray label disc) instead of creating a bootable USB installer. Or create a bootable macOS 10.11 USB installer.
What Linux distribution did you try? The most Mac friendly out of the box are Linux Mint and one of the Ubuntu flavors such as Kubuntu or Ubuntu-MATE since they can also work on a computer with more limited resources.
Create a bootable Knoppix USB stick so you can attempt to check the health of the internal drive by using GSmartControl found on the "Start Menu --> System Tools". Post the complete health report here using the "Additional Text" icon which looks like a piece of paper.
You can try checking the memory by running Memtest86.
You can also try creating and running the Apple Diagnostics by creating a bootable Apple diagnostics USB stick:
https://github.com/upekkha/AppleHardwareTest