You have a time limitation after final decison in your case to file.
The grounds is that you are being deprived of liberty without compelling reasons for the law you were convicted of therefore without due process of law contravening the Fourth and Fifth, or Fourteenth Amendments of the Constitution of the United States.
The habeas corpus statutes begin at 28 U.S.C. 2241. ( do search)
28 U.S. Code § 2255 - Federal custody; remedies on motion attacking sentence
State custody you must go through State remedies for post conviction relief first.