How to re-install an OS on Mac
The question mark comes up when the start up files have been messed up.

I do not know if you can repair the Magnet damage but you can try to restore.

Mac's have a Restore function build in (or online)

To access start computer and hold cmd-r

that will bring up the restore menu.

Depending on your computer model you might have the Internet restore option.

The sound you heard was the forced computer shut down.