How can you prevent a child from wetting the bed?

Depends. Enuresis is relatively common. Most people outgrow it by 13 yrs old. Time is the safest treatment. Medications sometimes are helpful. There are several choices. Ddavp (desmopressin) is helpful, as is tofranil (imipramine). Fluid restriction and use of alarm blankets can be helpful as well. Check with your doctor for the option that is best for you.
See wetting Dr after. 1) restricting all fluids after evening meal. 2) try waking a couple of hours after going to bed 3) try a bedwetting alarm eg "wet-stop" 4) then dr. 4 ? Desmopressin (ddavp) to reduce urine production at night 5) possibly long acting anticholinergic medication to increase functional bladder capacity. 6) Imipramine (tofranil) 7) avoid urodynamics or cystoscopy. Check pottymd.Com for products.