It is better to die without children, than to leave ungodly children
My advice, as the mom and godmother and teacher of many kids who have now become adults, some of the kids who were the most Godly, the kids who aced the Confirmation Test and who knew apologetics backwards and forwards, still stopped practicing. At the same time, some of the wild ones end up as Priests.
“Forming Intentional Disciples” and “Converting the Baptized” are important books for everyone including parents. Another excellent book is “Why Christian Kids Rebel”.
The big key is to foster critical thinking in your home. Allow the hard questions, and help your kids know where to find the answers or how to accept when the answer honestly is “it is a mystery”. Learning philosophy is important to combat the modern, emotional atheism. Trent Horn is an excellent resource, as are blogs like Strange Notions and podcasts like those done by podcaster “Max Kolbe”.
In the end, kids know what is genuine and what is not. If mom and dad come home from Mass only to criticize what Sally Sue was wearing and how terrible the homily was, if mom and dad hear that the Jones’ daughter is pregnant or the Smith’s son is gay and then say “I knew that that kid would end up that way” instead of “we need to show our love, let’s throw a baby shower for the Jones family” or “let’s have the Smiths over for dinner, and be sure to invite all of the kids!”. Your kids know if you walk the walk, and that makes them more likely to consider your faith something real.
But, never think you fail if your kid grows up to leave the Church. How we parent our adult kids in those times is with the love of the Father.