How do I reformat my Mac's internal drive without losing my data?
Don't reformat and hope to recover data afterward. Clone the drive first to an external drive with Carbon Copy Cloner or Disk Utility, then reformat, reinstall macOS, and copy back what you need. For failing drives, try recovery tools or an Apple service provider.