If you delete a user account in macOS and it reappears the next time you open the Users & Groups pane in System Preferences, you can use Directory Utility to remove the account.
Don't use Directory Utility to remove the only admin account on the Mac or an account that's logged in. In these cases, either create another admin account or log the user out, then remove the account in the Users & Groups pane in System Preferences.
- Log in with a user account that you would like to keep.
- Press Command-Space bar to open Spotlight. Type Directory Utility and press Return, or double-click Directory Utility in the Spotlight results.
- If the lock in the lower-left corner of the Directory Utility window is closed, click it and enter an admin user's name and password.
- Click Directory Editor in the Directory Utility window's toolbar.
- Choose Users from the Viewing pop-up menu (it's already selected if the logged-in user has never used Directory Editor).
- From the list on the left side of the Directory Utility window, select the user that you want to remove. You can use the Search field above the list to find the user in the list. The name you select should be identical to the name shown in the Users & Groups pane of System Preferences when that user is logged in.
- Click in the lower-left corner of the Directory Utility window.
- Verify that the selected user is the one that you want to be removed, then click the Delete button.
After you remove the user account, you can delete its folder:
- In the menu bar, choose Go > Go to Folder, type
/Users, and then press Return.
- Drag the folder for the account you just removed into the Trash.
- Choose Finder > Empty Trash to delete the folder and its contents.
Find out how to set your Mac to automatically log in during startup and what to do if automatic login is unavailable for an account.