Here's one of the best tutorials on BYC on training roosters.
https://www.backyardchickens.com/t/390911/important-how-to-deal-with-an-aggressive-rooster
I would read through the tutorials and see if it feels like something you want to take on. Here on your thread, you're liable to get as many useful replies as replies that are just plain nuts. No one can tell you how to train a rooster in one paragraph. The above link is an entire thread. There is a lot of useful info there.
I've trained tow problem roosters myself, and I can testify to roosters being far more intelligent than anyone gives them credit for, and they are trainable. My roosters had directly opposite problem personalities. One was aggressive and was a biter, and the other was so neurotic that he would have a meltdown if I so much as reached for him. It took a lot of time and patience but both boys were completely rehabilitated.
I agree that roosters can be very dangerous for children. By the very fact of their short stature, children are an easy target, and are very vulnerable. Your child should only be permitted around the rooster under close supervision until he grows tall enough and mature enough so that he can handle the rooster. Perhaps he can participate in helping to train your cockerel.