It happens to everyone -- you don't want to attend a special occasion or social obligation, and you need an excuse not to go. The real reason may be that you don't like the host, aren't interested in the event, or simply feel apathetic about the whole thing. Regardless, if you don't want to risk hurting anyone's feelings because you did not attend, offer a plausible excuse that will earn the host's forgiveness for your absence.
A death in the family is mother of all excuses in dealing with people you don't see often or who live far away. Those whom you see on a regular basis (or who know your family well) will be suspicious if they see everyone alive and happy. If you don't want to say that a human family member died, use the standby, "my dog died." Ensure that the excuse recipient never sees your dog -- or doesn't know whether you have one.
You don't run much risk of someone finding out your lie when you fake illness, but the result is just as effective as other types of excuses. If you're a skilled faker (this requires less of an act to do over the phone -- tell the person you can't see them because you're too sick) -- the recipient can't do much but accept the situation.
Offer the excuse that you have a conflicting function or obligation to attend. However, proceed with caution when you do so. Doctor's appointments are usually the best type of "conflict" to have because you must take care of your health before you attend anything. But don't pretend to have another social obligation with those you know well. They may accuse you of favouritism toward the other (fictional) host or believe you don't like them.. If you run in the same social circles, they may also find out you were lying.
Finally, work makes a convenient excuse to get out of things, but only if the excuse recipient isn't a co-worker (who might find out the truth). Tell the host that you have a work conflict in the form of a meeting, weekend retreat, or nighttime paperwork. Most understanding hosts will not want to see someone's livelihood suffer to attend a social function. If you need to get out of a work function, tell your boss you'll be attending a conference that day -- research an actual conference, including speakers and events to make your excuse seem legitimate. Even if you actually have to go, at least you get out of the office for an indefinite amount of time. Or make a doctor's appointment and go -- you'll get out of the office for at least a couple of hours.