Then your data is most likely gone for good. You should not attempt to format a rotational hard drive as apfs. ESPECIALLY your boot drive.
Use recovery mode to try and reinstall macOS. If you can't get it bootable by reinstalling over itself, you're going to have to reformat the drive and re-install macOS from scratch.