How can I prevent my child from getting cold sores?

Wash. Make sure you clean all dishes and anything that touches your child's mouth as cold sores are very infectuous and can recontaminate with repeatable exposures.
R & R. The virus behind cold sores lies dormant in the body until something triggers it to re-emerge, usually a phyiological or emotional stressor (eg. Another illness, a stressful life situation, jet lag). While rest and relaxation--physical and emotional healthy--won't "cure" a cold sore, they will enable your body to fight off the virus and--to keep it away.
You can't! Cold sores are caused by a herpes virus. Once a child is infected, the virus stays in their system and can reactivate at any time. There really is nothing you can do to "prevent" a recurrence of a cold sore.
Prevention. If you have frequent, painful outbreaks of cold sores, your doctor might give you an antiviral medicine to take every day to prevent new symptoms. Most people don't need this kind of treatment. To protect others when you have an outbreak , don't kiss anyone, and don't share forks, knives, spoons, glasses, towels, lip balm.
Cannot be prevented. Cold sores on the lips or near the lips, are usually caused by oral herpes virus. Sores appear more often when a child is under stress or is ill from another illness. For older children and adults who get sores repeatedly, a doctor may prescribe an antiviral (acyclovir, valtrex, (valacyclovir) etc...) to prevent future outbreaks. For babies or younger children, there is no medicine to prevent the sores.