good manners appear naturally.
Teach a child to say "hello" or "thank you" is not the first step at all. It is much more important to teach him to love people. If he does not fall in love with them, it will be difficult to teach him superficial good manners.
The second step is not to concentrate on it in the presence of strangers. We are always inclined, especially with the first-born, to immediately imagine him and force him to say something. But when you do this with a two-year-old child, he is embarrassed. And he gets used to feel embarrassed and awkward when he sees that you are saying hello, because he knows: now it's his turn. Much better in the first three or four years, when the child needs time to get used to a stranger, first to withdraw the conversation from him, and not talk about him at once. A child in three or four years usually listens for a few minutes, as the mother talks with an unfamiliar aunt, and then we interfere into the conversation with comments like: "The water filled the whole floor in the toilet."Of course, this is not the manner of Lord Chesterfield, this is his real manners, because now the child wants to take part in the conversation. If he continues to have such an attitude towards strangers, he will learn to talk in a friendly manner as usual.
The third and probably the most important condition - the child should grow up in a family, all members of which are attentive to each other. Here he absorbs kindness. He wants to say "thank you", because this is what other family members do and because they are sincerely grateful. He will gladly take off his hat in front of a woman, because he really wants to be like Dad.
Of course, the child needs to be taught to be polite and considerate. If this is done in a friendly way, the child learns with pleasure. More importantly, everyone likes a child with good manners, and does not like rough and inattentive. Parents should raise a child in such a way that others love him. This, in turn, makes it more friendly.
When you teach a child good manners, try to do it with him alone, and not in the presence of outsiders, who will embarrass him.