what can i do to not cause static electricity when working on computer hardware?

plug computer into power supply and switch off at wall. that will keep you earthed. Then ensure you have one hand in contact with the metal of the case at all times (to maintain earth through your body).