In order to erase a Mac properly, all data will need to be erased. However, as you said, since your Mac is older and not receiving updates anymore, it may be safer to create a bootable macOS installer to use to erase your Mac and reinstall macOS rather than relying on internet recovery.
To begin, refer to this Apple Support article, Create a bootable installer for macOS - Apple Support, and follow the steps to create a High Sierra bootable installer. You'll need an external storage device, that can be erased, for this.
Next, you can follow these steps to erase your Mac:
- Turn on your Mac, with the installer connected, then immediately press and hold the Option (Alt) key.
- Release the Option key when you see a dark screen showing your bootable volumes.
- Select the volume containing the bootable installer. Then click the onscreen arrow or press Return.
- From the utilities window, select Disk Utility and click Continue.
- Select Macintosh HD in the sidebar of Disk Utility.
- Click the Erase button in the toolbar, then enter the requested details:
- Name: Macintosh HD
- Format: APFS or Mac OS Extended (Journaled), as recommended by Disk Utility
- Click Erase.
- When done, quit Disk Utility to return to the utilities window.
- If you want your Mac to start up again from the volume you just you erased, select Reinstall macOS in the utilities window, then click Continue and follow the onscreen instructions.
-Jack