Petition for Relief From a Conviction or Sentence By a Person in State Custody (Petition Under 28 U. S. C. § 2254 for a Writ of Habeas Corpus). Petition for Writ of Habeas Corpus.You should use this form if. ☐Article of the Family Court Act. Docket No. ☐Section of the Social Services Law. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. Print it underneath. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court.