The specifics differ by country, but a few principles keep you safe almost anywhere. Watch what locals do and mirror it, especially around greetings, shoes, and religious sites. When unsure, err on the side of formal and reserved; nobody was ever offended by a visitor being slightly too polite.
Greetings deserve special attention because they are your first impression. Some cultures shake hands firmly, others bow, others exchange cheek kisses, and in some, physical contact between genders is avoided entirely. Let the local person initiate and follow their lead. Gestures are a hidden minefield too: a thumbs up, an OK sign, pointing with a finger, or showing the sole of your foot are innocent in some countries and rude in others.
Beyond that, learn the local norms around shoes indoors, dress at religious sites, using the right hand for giving and receiving, and voice volume in public. A short read of a reliable culture guide for your specific destination before arrival pays off more than almost any other preparation.