A mom and science writer offers an operating manual for parents grappling with kids’ screen use and cravings for sweets.