Having to withdraw a job offer you have already accepted is a delicate and stressful situation. Your would-be employers may be sympathetic or they may be angry at being inconvenienced. Their reaction is not completely out of your hands, however. There are ways you can make this uncomfortable task go smoothly. You may even learn from the situation by becoming better at communicating unpleasant decisions with grace and tact.
Be polite and apologetic. Making a commitment and then backing out may be viewed as unprofessional, so it's your job to extract yourself from the situation looking like a professional and leaving no hard feelings. In your communications with the company, be sincere and apologise without defensiveness.
Avoid making excuses. You probably have a very good reason that you are withdrawing your acceptance. Still, dwelling on these reasons or giving too much unnecessary information will sound like you are making excuses. Instead, take full responsibility for your actions and provide a brief explanation. Avoid sounding as though you are looking for sympathy if you are withdrawing the acceptance because of negative life circumstances.
Inform your former employers as soon as possible. Although you may be nervous about letting your former employers down, the longer you wait, the worse it will be. Not only are you giving them less time to find a suitable replacement, but leaving it to the last minute will leave them with a very negative impression of you.
Prepare for the fallout. By accepting and then declining this job offer, you may have put the company in general or the person who made the decision to hire you specifically in a bind. There may be some exasperation or hostility. Keep your cool and remain calm throughout your interactions. You may also be barred from future employment with this company. You may be burning bridges, so think about your decision very carefully before taking any steps to rescind your acceptance.
Gauge the situation to determine whether a phone call or e-mail would be best. If your interview process was extensive and you feel you have bonded with the hiring team, it would be best to speak to your contact on the phone. This shows more respect and courtesy, though it will also take more courage. If you feel you cannot make this phone call, a polite e-mail will do, but if someone does call you or replies to your e-mail indicating they would like to talk to you, you should answer the phone or call them back promptly. Failing to do so would be considered rude.