I put a magnet over my MacBook Pro 2011
If your drive is formatted with HFS+ and not APFS, you may be able to use DiskWarrior to repair your drive enough to use Target Disk Mode to extract your data through another Mac onto another disk. However, if the magnet damaged the partition table, or primary and alternate volume headers, or too much of the catalog &amp; extents files, DiskWarrior may not be able to help. In that case you may have to use a professional recovery service like DriveSavers or face the music and start over.
In any of the above situations, once you've gotten your data recovered (or decided not to), you will need to do a full erase &amp; install of macOS. You can do this by creating a bootable installer on another Mac.