The Yucatan Peninsula's areas that tourists visit consist mostly of resorts and hotel zones that cater to tourists.  The general rule for tourists in this region is stay on the resort or tourist-dominated area, the only exception being when you embark on guided tours that leave from the resort or hotel.  Venturing to nearby local neighborhoods alone is not a good idea, as some are not safe.  If you are an adventurous type and want to do some exploring on your own, do your research on the specific area you're staying in.  Ask the resort about the safety in the area.  Don't always trust what all websites and/or travel brochures have to say about safety, because sometimes their agenda is simply to promote the location.  Be cautious, and use common sense.

All food is generally safe to eat, but use your judgement.  Drinking water in hotels and resorts may be filtered but drinking only bottled water (even brushing your teeth with it) is the safe way to go.