"Do unto others what you would have them do unto you," a staple of most religious traditions, is a philosophy known as the golden rule.
Sometimes it is cast in the negative:
Buddhism: Hurt not others in ways that you yourself would find hurtful (Udanavarga).
Confucianism: Do not unto others what you would not have them do unto you (Analects 15:2).
Hinduism: Do naught unto others [that] which would cause you pain if done to you (Mahabharata 5:1517).
Judaism: That which is hateful unto you, do not impose on others (Talmud, Shabbat 31a).
Other times it is put in positive terms:
Christianity: As you wish that men would do to you, do so to them (Luke 6:13).
Islam: No one of you is a believer until he desires for his brother that which he desires for himself (Sunan).