The process, which is almost always followed all the way in death penalty cases but not so often in other cases goes like this, assuming that the case begins as a prosecution in a state court, and with variations for individual state procedures:
1. State trial court - all pre-trial proceedings, ultimately leading to trial, post-trial motions and sentencing.
2. State direct appeal - the conviction is appealed through the state court appeal system which often has two levels, an initial reviewing court to which appeal is automatic and a final court of appeal to which appeal may be discretionary. This appeal is limited to matters which appear in the trial record. After the state's highest court has denied relief, review of federal issues in the case can be sought from the United States Supreme Court by petition for writ of certiorari.
3. State collateral review - Matters which do not appear in the record (typically such claims as failure by the prosecution to disclose material evidence; often claims of ineffective assistance of trial counsel) must be brought by a collateral petition known variously as a post-conviction petition, state habeas corpus petition, or other names. This petition is typically heard by the judge who heard the original trial.
4. State collateral appeal - The denial of a collateral petition is appealed through the state court system. Again, if the state's highest court denies relief, review of federal issues in the case can be sought by petition to the United States Supreme Court for writ of certiorari.
5. federal habeas corpus - Once all state court remedies have been exhausted without success, and only then, any federal issues in the case can be brought before the federal district court on petition for federal habeas corpus relief. This review will normally be available to address any federal claim that was properly developed on direct appeal or in collateral proceedings.
6. Federal habeas appeal - an unsuccessful outcome before the federal district court is appealed to the United States Court of Appeals. If the Court of Appeals denies relief, review can be sought by petition to the United States Supreme Court for writ of certiorari.
That is the system from beginning to end. Sometimes a case bounces back and forth multiple times between stages, as when an appellate court remands a case for further proceedings (which essentially means, "Do it again do it right this time.")
Many states have additional collateral remedies appropriate in special situations. If all judicial remedies fail, the governor can be approached for the exercise of executive clemency by a request for pardon or commutation of sentence.
Need I say that the farther a case moves along the system the harder it usually is to get relief.