In Washington state court cases, if post-conviction relief is available, a "personal restraint petition" often must be filed.  The petition is filed after the defendant has pursued all of his or her "direct" options, such as an appeal.  

In other words, the petition is filed after the case concludes.  If all of the options at the state level have been pursued, and the convicted person still seeks relief, he or she may file a habeas corpus petition in federal court.  

So, the post-conviction order is: 1. appeal first, if you can 2. then file a personal restraint petition 3. if relief is still needed, file a habeas corpus petition.  

For each of these options, the process is complex and involves unforgiving deadlines.  If an appeal or petition is not timely filed, it will be extremely difficult--sometimes impossible--to succeed.