I think you should erase your internal hard drive and reinstall macOS after getting the important files off your Mac.
To restore data from the unbootable Mac, you can run iBoysoft Data Recovery for Mac from Recovery Mode. It'll allow you to preview all files on your Mac for free and then you can decide what to restore.
This professional data recovery software is compatible with all sorts of file types, including images, videos, audio, emails, documents, etc. It also supports all macOS versions since Mac OS X El Capitan running on Intel-based, T2, M1 and M2 Macs.
After you have recovered necessary data from the Mac that won't boot, you can follow the steps to perform a clean macOS installation.
- Open Disk Utility from Recovery Mode.
- Click View > Show All Devices.
- Select the top-level physical disk, which may be labeled Apple SSD or ST0589345ASG Media.
- Click the Erase button.
- Give it a name.
- Choose APFS as format if running macOS macOS Sierra and later. Otherwise, choose Mac OS Extended (Journaled).
- Set the scheme to GUID Partition Map.
- Click Erase.
- One the erase process is complete, exit Disk Utility and click Reinstall macOS.