Back up all data.
Launch the Directory Utility application. Depending on what version of OS X you have, you may be able to do that by entering the first few letters of its name in a Spotlight search. If that doesn't work, triple-click anywhere in the line of text below on this page to select it:
/System/Library/CoreServices
Right-click or control-click the selected text and select
Services ▹ Open
from the contextual menu.* A folder named "CoreServices" will open. The Directory Utility application is in that folder, or in a subfolder named "Applications".
In the Directory Utility window, click the lock icon and authenticate. Select the Directory Editor tool in the toolbar. Select Users from the Viewing menu in the toolbar, if not already selected. Locate the user you want to delete in the list and click the minus-sign icon at the bottom. Select Groups from the Viewing menu, and look for a group in the list with the same name as the user you just deleted. If found, delete. Quit Directory Utility.
Be very careful when editing the directory. Many hidden users and groups are present by default, and are needed for the normal operation of OS X. Never delete or modify a directory entry unless you’re sure you know what you’re doing. If in doubt, leave it alone.
*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
Go ▹ Go to Folder...
from the menu bar and paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.