Many of us find guidance in religion. For those of us who don't, there are a couple of rules that I have found to be helpful in my life so I will share them.
First: Before you speak, write or act, consider what you hope to achieve and whether or not that action will achieve that goal. For instance, someone says something nasty, your instinct might be to lash back but how will that make you feel in the long run? Through trial and error I have found that lashing back can often feel good for an instant and bad for the long run. There is a lasting satisfaction in taking the high road.
Second: What goes around, comes around. If your are good to others, it might not come back immediately and it might not come back from those you were good to, but it will come back. Same goes for ill will.
Lastly: The golden rule, be true to yourself. Get to know yourself. Learn to become someone you love and others will love you to.
These seem simple and obvious. A lot of people reading might be thinking, "duh!" but it seems like there are a lot of people ignoring these rules if they are indeed aware of them.
Best wishes.