Wikipedia has an excellent explanation of this so I will quote part of it directly.
The Golden Rule is the principle of treating others as you want to be treated. It is a maxim that is found in many religions and cultures. It can be considered an ethic of reciprocity in some religions, although other religions treat it differently. The maxim may appear as a positive or negative injunction governing conduct:
Treat others as you would like others to treat you (positive or directive form)
Do not treat others in ways that you would not like to be treated (negative or prohibitive form)
What you wish upon others, you wish upon yourself (empathic or responsive form)
The idea dates at least to the early Confucian times (551–479 BC), according to Rushworth Kidder, who identifies that this concept appears prominently in Buddhism, Christianity, Hinduism, Judaism, Taoism, Zoroastrianism, and "the rest of the world's major religions". The concept of the Rule is codified in the Code of Hammurabi stele and tablets (1754-1790 BC). 143 leaders of the world's major faiths endorsed the Golden Rule as part of the 1993 "Declaration Toward a Global Ethic". According to Greg M. Epstein, it is "a concept that essentially no religion misses entirely", but belief in God is not necessary to endorse it. Simon Blackburn also states that the Golden Rule can be "found in some form in almost every ethical tradition".
I was raised in a Christian environment as my parents were members of the Lutheran Church, so I was baptized there when I was a baby and from my earliest memories I had to go to church every Sunday, first to Sunday School when I was small, and then to regular church services when I got older. Then when I was in junior high school I had to go to Confirmation Classes every Saturday for two hours to study the Bible. After passing that class, one then becomes a full member of the church and canreceive the Eucharist. This is also called the sacrament and is a ceremony in the church where parishioners go up to the altar and the minister/priest gives each person a small bread wafer and small glass of wine. The bread represents the body of Christ and the wine represents the blood of Christ. The minister/priest repeats those phrases each time a parishioner is given those items.
Returning to the Golden Rule: there are those who also define it differently and sarcastically to mean “he who has the gold makes the rule” which means that people who have great wealth are able to make rules that are beneficial to themselves. In other words, they are able to “buy” privileges and special favors which other people are unable to do.