In Latin, “alibi” literally means “somewhere else.” In a court of law, it means that someone was in a location distant enough from the scene of a crime that he or she could not have committed the crime, and the individual is therefore innocent. Many people attempt to establish an alibi as part of a mode of defense, because a provable alibi indicates that someone is innocent, and it can result in the decision to drop charges. However, as one might imagine, it can be challenging to build up a good alibi.
In a classic example of an alibi, person X is accused of committing a crime, but person Y steps forward and says that he or she was with person X at the time of the crime. This alibi could be provable if evidence could be presented to support the claim made by person Y. For example, if the two ate out at a restaurant, they might have been caught on surveillance cameras, or a credit card receipt might prove that the two sat together. If a waitperson could confirm their claim of eating together on the night of the crime in question, that in combination with the supporting evidence might lead to a decision to drop charges.
More commonly, people have partial alibis which would not hold up in court. Typically, such alibi claims are investigated by law enforcement, and law enforcement personnel determine whether or not the claim holds water. Typically, an alibi investigation is carried out long before a case is brought to trial, as everyone wants to avoid the expense and lost time involved in trying the wrong person.
Someone who is accused of a crime has access to a lawyer in most regions. One of the first questions a lawyer may ask is whether or not the person has an alibi. A good lawyer will walk someone through his or her acts on the night in question, to collect evidence which could be used to support an alibi. Something seemingly unimportant like picking up cash at an Automatic Teller Machine (ATM) could turn out to the linchpin of an alibi, since bank records and recordings from the ATM could prove that it was not physically possible for someone to commit a crime.
Naturally, there are other modes of defense for proving innocence. In a well run legal system, an innocent person should ideally never be convicted of a crime, although wrongful convictions do happen. In addition to working to establish an alibi, a defense team will typically pursue other lines of inquiry to confirm someone's innocence.
Some companies offer alibi services to people, typically for people who want to conceal illicit relationships or dealings. Such companies may create receipts and other documents to prove someone's presence at a location, and they may offer phone rerouting and similar services. Most companies which offer these types of services make it clear that they will not assist people who are committing illegal acts; since alibi services are ultimately traceable, if you're planning on murdering someone, don't count on an alibi service to help you evade punishment.