To wipe your MacBook and keep programs, create a backup for your files for easy recovery after erasing. Then, use the Disk Utility function to delete all files on your device. Finally, reinstall your macOS and restore your programs from back up.