The writ of habeas corpus is issued to a detaining authority, ordering the detainer to produce the detained person in the issuing court, along with the cause of his or her detention. If the detention is found to be illegal, the court issues an order to set the person free.
The writ of certiorari is issued to a lower court directing that the record of a case be sent up for review, together with all supporting files, evidence and documents, usually with the intention of overruling the judgement of the lower court. It is one of the mechanisms by which the fundamental rights of the citizens are upheld.
The writ of mandamus is issued to a subordinate court, an officer of government, or a corporation or other institution commanding the performance of certain acts or duties.
The writ of quo warranto is issued against a person who claims or usurps a public office. Through this writ the court inquires 'by what authority' the person supports his or her.