As one who teaches baptism classes at our parish, the canonical rule is that a child must attend catechism lessons if they have reached the age of 7, considered the age of reason.
However, we strongly encourage parents and godparents to instruct any child who is able to understand and is already speaking, age 2,3,4…to be told what to expect, even practice pouring water over them. Bring them to church, show them the font…etc…Tell them what is happening, so they are not frightened when a priest or deacon is baptizing them. Common sense tells you that, as well as loving parents who want to share the faith with their little one. Age appropriate of course.