You can name a legal guardian for your children in your will, but the court isn't obliged to appoint that person Instead, it will assess your choice and the situation and decide what is best ...
Learn the basics about court appointed guardians. ...