Family Law Questions? Ask a Family Lawyer Online.
You will want to petition the courts for custody based on the best interest of the child. I would advise you to hire a lawyer as they can get a emergency hearing in quickly and see if the judge will grant you custody based on the living arrangements of the child.
If this is not a possibility to hire a lawyer you will need to fill out the forms at the following link: Divorce Source: State Specific - Modification Forms for Custody ... Fill them out completely and submit them to your local clerk of courts office with the filing fee's. The clerk will help you get the paperwork needed to serve the grandmother and will set up a hearing for a temporary custody order. Once that is granted the courts will set up a home study and if you are approved it will go back to court for a final order.
I wish you the best,