It's easy to post something stupid to Twitter in the heat of the moment, but how can you get rid of it? In theory, you can delete any unwanted Twitter posts you've created by clicking on the delete icon next to them, but sometimes Twitter's notoriously picky API gets moody and doesn't want to help. If that happens, don't despair.
First, find the nine-digit status number of the message in question by going to twitter.com/yourusername and looking at the time stamp ('x minutes ago') of the offending post. The end of its URL will be a nine-digit number identifying your post. Then enter this location into your browser, replacing 123456789 with the status number:
Twitter will ask for your username and password, and then you'll likely receive an error message saying the XML file doesn't have any style information. However, if you go back and check your history, you'll find the tweet with that number will have been deleted. (Thanks Paul M.)