Dressing modestly and being respectful, especially in areas of stronger Muslim religious sensibilities such as the northeastern states of Peninsula Malaysia, will ensure you travel with minimum hassle. When visiting mosques, cover your head and limbs with a headscarf and sarong (many mosques lend these out at the entrance). At the beach, most Malaysian women swim fully clothed in T-shirts and shorts, so don’t even think about going topless.
Be proactive about your own safety. Treat overly friendly strangers, both male and female, with a good deal of caution. Take taxis after dark and avoid walking alone at night in quiet or seedy parts of town.