How to discharge static electricity before opening a computer?
Solution 1:
Touching any conductive material that is grounded will also ground you. As long as you are using a 3-prong outlet, your metal case should be grounded through the third (round) prong. You can also touch water pipes, metal conduit, or another person, though none of these are guaranteed to be grounded.
Any loose, woollen, or static-generating clothing should be avoided. Metal armor, though providing an excellent ground, should also be avoided. If you are really concerned about cleanliness, you could also avoid any clothing that will generate a lot of lint. This usually isn't a big deal, though.
Solution 2:
Best practice is to NOT leave equipment plugged in and switched off to give you a grounded surface because when you touch or hold on to this to ground yourself YOU HAVE NO CURRENT LIMITING SAFETY DEVICE in the circuit between yourself and ground, so if you do touch a live part (maybe the PSU is faulty and the outlet power switch has been wired in the non-hot line) - even perhaps something nearby like a faulty desk lamp or the printer that actually has the fault (and has blown up the PC), you do not experience a hand-to-hand fault current to ground, which is VERY DANGEROUS because the fault path is via your heart. This is why engineers who have to work on (high voltage) live equipment are supposed to keep one hand in a pocket - it stops them from getting a shock from the hand holding the screwdriver to the hand touching the equipment chassis; instead, they get a jolt down the leg which can flippin' hurt, but is less likely to kill them.
Proper use of the wrist strap (above left) is to either connect it to a grounding point (above right) to drain away any static you have generated OR to the metal chassis of the kit you are working on BUT the kit is still NOT grounded via a power cord and you are just using the strap for charge equalisation.
If you do not have the proper grounding wrist strap with safety resistor or an antistatic kit/workbench, just use the charge equalisation technique that Scott mentioned (with the equipment totally disconnected from the power outlet) OR just briefly touch a grounded metal pipe or connector and then work on the kit without holding onto anything grounded.
With regards to clothing, working naked is best but this may upset your friends/customers. Natural grown fibres/materials are next best - cotton or linen, but not wool or silk - so engineers that turn up in white cotton T-shirts and denim jeans with leather-soled shoes may look a tad casual but are less likely to be a walking static bomb. If you have to preserve a corporate appearance in front of your customers, a polyester suit may look the biz but may help you zap their server.
Solution 3:
One word: Humidity.
If you want to know why, read up on static electricity. Initially grounding yourself will neutralize any static that you are carrying, but if you have a very dry atmosphere you can easily pick it back up again with just normal activity --- humidity helps prevent static electricity from building up by allowing it to bleed off into the atmosphere without having to be suddenly discharged. (Why? Because humidity makes the air a conductor.)
That's why you experience more static electricity discharges in the winter time, when the furnace is running (and there is no humidifier present, and there is nothing else present to introduce humidity).
If you have a more than passing interest as to why, start by reading the article at Wikipedia, which is a good starting point to more full-bodied research.
Having a wrist strap that keeps you connected to a ground all the time works, as well, if you cannot increase the humidity of your environment to a sufficient level (30% - 40%, which happens to also be optimal for human comfort and to keep things like paint from cracking on walls, seems to work well in my personal experience).
Solution 4:
1) unplug your computer;
2) touch the case;
3) don't pet any cats, rub your hair on an inflated balloon, drag feet on carpet while you do your work.
If you want ultra-high ESD protection, get a grounding strap and attach to case.