Most states give first rights to immediate family members for raising a child. You should look up your rights (Google it?) online and get a clear picture of where you stand, legally.
Here's some steps you could take beyond 1st finding out your rights:
1. Volunteer for a drug testing (even if you have to apply for a job, maybe a job you don't even really want, like Home Depot, that requires such a test -- then you'd get it for free).
2. Find parenting classes in your area and take them, and be really responsible about taking (and learning from) them. Get the certificate of completion for taking them.
3. Be sure your housing is in a safe neighborhood of good repute. It doesn't need to be expensive or owned by you, but should be exceptionally clean and cared for, with safety measures in place (screens in windows) and NO pet problems (poop in the house, yard, fleas, sick animals, mean animals, etc.)
4. Know as much as possible about schools in your area, and think about volunteering there even before you get your grandchild.
5. Know your neighbors. Check out the surrounding area for people who have been placed on the registry for offenses (online).
6. Be sure your general finances are in order. No one wants to place a child with someone who can't control their spending or hoarding or debt or serious money problems.
7. Line up those people who can speak for your overall character and attitude about life, NOT relatives. Do you have someone at a church who knows your goodness? A neighbor you help? A counselor at a 12-step meeting? Someone in a position of objectivity about who you are?
8. Look for an advocate for grandparents who foster children. Sometimes attorneys in an area have a colleague who specifically works to help people such as yourself. Calmly and consistently, pester this advocate to take on your case and give them all the reasons why your grandchild should be with you. Prove it to them by all you do that's good for this child and for making a good future for this child. Prove to this advocate that you are making every effort to become a better person yourself, so that you can serve the needs of your grandchild, and don't give up.
I hope this helps. As a former Children's Service Worker, I wish you well. Keep your goal right in front of your eyes and stay true!