Call the person with whom you have an appointment as soon as you become aware that you will not be able to make it. This prevents the other party from preparing for a meeting that will not happen. It also gives her a chance to fill that time with something productive.
Avoid long-winded discussion when you call. Remember that the other person may be at work, and her time is valuable. Simply explain that you will not be able to make it and, if you wish, ask to reschedule the appointment. You are not required to give a detailed explanation of the reason you can't keep the appointment. You can simply say that something has come up.
Use polite language and be apologetic. Something like, "I'm sorry to waste your time like this," acknowledges that you respect the person's time and you understand that this is an inconvenience.