Habeas corpus is a law that states that a person cannot be kept in prison unless they have first been brought before a court of law. So, a writ of habeas corpus is a court order to bring a person who's been detained to court to determine whether or not their detention is valid.Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. A writ of habeas corpus is an order from a court to an official to produce an inmate. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. This right allows individuals to challenge their detention or imprisonment. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty.