If you find that you need to reject a job offer, the most important thing is to be polite, honest, and respectful. You never know if you will need or want to work with this company in the future, or if they are in contact with other companies with whom you might want to work. Depending on the extent of the interview process, and the amount of time that the company has invested in you already, you may want to reject the offer in a formal letter as well as over the phone.
Before you reject any job offer, consider why you are rejecting it. In some cases, it may be obvious, but other times, you may realize that with some negotiation, you might want to accept the job after all. Consider what parameters you would be willing to accept that would make you willing take the job. Do not, however, appear to the company as if you are willing to negotiate if you aren't, because that isn't fair to anyone. Whatever you choose to do, remain firm, and do not waffle back and forth in your decision.
When you have decided to reject the offer, be straightforward about it and be honest about your reasons. If you were offered another position elsewhere, if you would prefer to live in another location, if the position is not related to your career goals, or if you simply need a higher income, share those reasons with the company. You do not need to go into detail in any of these situations, but simply sharing the information is necessary. It is always better to be honest than to try to hide something and be found out later, which can reflect very poorly on you.
Always remember to thank the company for their time, and for considering you for the employment opportunity. Do not burn any bridges; tact and politeness will go a long way. If you must reject a job offer from your present employer, such as for a promotion or different position within the company, the same rules apply. It is important to explain why you feel that you want to remain in your current position, or what would specifically make you consider accepting the new position. Negotiation in these situations as fine, as long as you are aware of the possibility that you could end up unemployed at the end of it.