You want custody of your child when you and your spouse get divorced, and you know it’s going to be a battle. You’re ready to dig in your heels and do everything you can to fight for it. That relationship with your child means more to you than anything else.

But what should you really do? How can you fight for your family and fight to keep that relationship alive? Below are six tips that can help.

1. Show the court that you’re a great parent.

Don’t just tell them. If you show up late, don’t show much interest in your child, and don’t dress properly for court, it can change their opinion of you. Your claims that you’re a good, loving parent may ring hollow since you’re not even taking the time to put your best foot forward during the case.

2. Be open to an evaluation.

Some experts even suggest you request an evaluation of your home. You know you have nothing to hide, but your ex may make it sound like your home isn’t safe for the child or presents a less-than-ideal living situation. The evaluation helps get the truth in front of the court.

3. Document all critical details.

Perhaps you think your ex shouldn’t get custody because of things he or she has said or interactions he or she has had with the child. Again, don’t just tell the court. When possible, have documents that give more details and back up your claims. Even simply taking notes that spell out the details can help.

4. Keep your negativity to yourself.

Ignore any temptations to talk down about your ex to the child, especially if things grow contentious in court. Don’t give in. Keep the conflict between the two of you. This helps show that you have your kid’s best interests in mind and that you’re not acting out of spite toward your ex.

5. Be open to court suggestions.

For instance, some courts may ask if you’re open to counseling and parenting classes. They may not be your favorite way to spend time after work, but be open to them and be willing to work with the court. Show that you care and you’re committed to the child.

6. Be honest.

Some parents believe that it’ll be easier to win by lying about the other parent. For instance, you may be tempted to say your spouse abused the child when that never happened. Don’t do it. Lying severely jeopardizes your chance to win.

At the end of the day, be sure you know your legal rights and all of the options that you have. Stay committed to your kids. Understand that it may get hard, but there are plenty of things you can do to get custody.