There is not enough details here for someone to give you a good answer. Divorce law is by State and there are different filings depending if it is going to be contested or uncontested. The best advice I can give is to see a lawyer or legal aid rep. Good luck.
You get a lawyer to write up the divorce papers and then you both have you sign them. As for children, well, fortunately for you (unfortunately for most men) often times the judges are somewhat bias when it comes to children, believing that the mothers should have them rather then the fathers (the reason I don't like this is that it happened to my cousin, and her mom is pretty abusive). Still there is a chance you may end up loosing them unless you have evidence proving that you're the better choice.