The purpose of a federal writ of habeas corpus petition is to obtain a specific legal remedy from the court, usually a release from prison, a change in the conditions of an inmate’s imprisonment, or relief from a prison sentence that is unconstitutional.