If you erase the internal disk using Disk Utility, then all of your data will be gone.
After erasing the disk, continue on with a reinstall of the macOS system. When the install is complete, you will boot to the system, at the point where you set up a new user. If you are resetting the Mac for a different user, or you are just getting it ready to sell, either way---at the new user setup, just choose to shut off the Mac. When it is next turned on, THAT person can continue on with a new user setup, as needed. That, my friend, is what you can call a factory reset.