I’m pasting this here, just to remember. It’s from a short but excellent post on parenting by C.J. Mahaney.
You have the privilege of introducing them to God the Father and describing the ways in which he is different from you, different from all sinful fathers, and how in any way you are like him it’s only because of grace that you reflect him. See Luke 11:11–13.
Your honest confession of your sin to your children will protect them from having hard thoughts about you or God.
Requiring appropriate obedience does not promote hard thoughts about God. This only happens when we do so in self-righteousness or anger.