Be respectful by taking your dress cues from the locals who wear tops over the shoulder and trousers below the knee. 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 – while you might not want to follow suit, choosing a modest bathing costume will save you any potential hassle.
Malaysia is generally a safe country but it is prudent to be proactive about personal 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.