To access the data stored on the drive on a Mac not turning on, you can physically take it out of your Mac and mount it on another Mac.
Mac not turning on and Mac not booting up are totally two different scenarios, the solutions for MacBook won't boot up are not helpful for a dead Mac, which is the state when you press the power button on your Mac but it doesn't respond.
Removing the drive inside of your Mac is a dangerous and intricate procedure. You should get professional assistance to ensure the protection of your data. It is necessary to take off the internal hard drive from the Mac logic board, place it in an enclosure, and then link the removed drive to another Mac via a cable.
Not all Macs, meanwhile, have detachable internal hard drives. Things get complicated for a Mac that uses new technologies, such as onboard SSD, Apple T2 Security encryption, and Apple silicons.