Growing up, what the teachers and my mother used to say was, "Treat others the way you want to be treated." It was a worn-down saying, the proclaimed "Golden Rule" that encouraged us kids to regard each other with kindness rather than nastiness. The concept of a rule for a kid though is never really something self-enforced.
Similar to the Golden Rule, the word "karma" is openly used in daily life. If something horrible happened to a bad person, then it was called their karma -- they simply had it coming back to them.
When I was around fourteen, I helped an elderly woman in a wheelchair make her way back to her apartment, and I later jokingly told my mother that I fulfilled my good karma for the day.
"You shouldn't help people for good karma, because then you're only doing it to help yourself," she told me. It's a statement that has stayed with me even today, making me question why I and others treated people the way that we do.
The actual concept of karma was something later elaborated to me by a Buddhist acquaintance. When we usually say karma, we mean to say "vipaka". Karma and vipaka are both Buddhist concepts that indicate doing an action and having the effects of that action come back to us. Karma is the activity driven by volition, and vipaka is the resulting effect. It's very "you reap what you sow."
So obviously what we communicate and do in our lives eventually comes back to us. If we treat people badly, it's very likely that we'll be treated without care in return. If an action commits you to do harm, perhaps vipaka will not be so kind or good. The world seems to be a precarious balance of observing what you send out into the universe, lest the universe returns misery to you.
In Wicca, there's a common (albeit controversial) law tied to the Wiccan Rede referred to as "the Rule of Three". Of most concepts I've learned centered around "send to the universe what you want sent back," this is probably what had stuck with me the most, although the Golden Rule and karma/vipaka certainly helped shaped my caution and kindness as well.
The Rule of Three -- sometimes referred to as "the Threefold Law" or "the Law of Return" -- is a law of caution to warn those that practice magic to use it responsibly, because what we do will come back threefold, be it good or bad. The Rule of Three holds higher stakes than the Golden Rule, the consequences dealt by the hands of the universe rather than just people.
Some Pagans (Wiccan and not alike) I've met live by in the Rule of Three to keep them from doing harm, others replace three with another number, and there are others I've met that don't believe in it all or have various interpretations of it.
Sometimes I want to forget any kind of law and act horribly to people that I think deserve it. It's a need I have to spite the Higher Forces overlooking us. I'm sure no matter your beliefs, you have heard the same song of bad things happening to good people. Over the years, I've witnessed my share of it; the kindest people I've met who seem to be denied happiness and only given more misery to be buried in. It was always so unfair to me, and it didn't seem to make sense why these good people were given a disproportionate amount of negative events. Some might say it's the result of karma from a previous life.
Unlike fourteen-year-old me, these people in my life are still good and kind of their own volition, without the ulterior motive of wanting good things to come back to them. It's a mindset I've done my best to adopt as well the older I get. True, sometimes I want the satisfaction of teaching a lesson to a person who deserves it, but in general, I try to give kindness when I can, rather than not.
Whether or not you believe in any of these laws of returning positivity/negativity, in our current society, having some good vibes sent back to us is a lot more preferable than more misery. When you can, send kindness to the world.