I agree with the other attorneys' answers. Habeas corpus petitions are very rarely successful, so it's really in your interest to contact an attorney. You should look up the website for the Prison Law Office. Their site has a lot of reference materials for you so that you can understand the habeas process, and you can try contacting their staff for advice on your friend's case. Good luck to both of you.
If your not a lawyer you cannot practice law. You cannot charge for preparing legal documents requiring a lawyer. If you want to volunteer and give the basis of your research to your friend to file in pro per, possibly yes.
The above is general legal and business analysis. It is not "legal advice" but analysis, and different lawyers may analyse this matter differently, especially if there are additional facts not reflected in the question. I am not your attorney until retained by a written retainer agreement signed by both of us. I am only licensed in California. See also avvo.com terms and conditions item 9, incorporated as if it was reprinted here.
If you are not an attorney this is not a good idea. It would be better to help pay for an attorney.
Mr. Driessen is a former Deputy DA in Orange County with over 8 years of criminal law experience. Nothing stated on this site shall in anyway be construed as legal advice, or as creating any attorney client relationship. If you would like to hire Mr. Driessen, feel free to contact him at www.theocduiguy.com.