And just as you want men to do to you, you also do to them likewise.
One thing I had to learn about the command Jesus gave above, is that when we treat others the way we want to be treated we are not guaranteed to get that treatment back! Jesus tells us to treat people the way we want to be treated because it brings Him glory when we reflect the love of Christ.
If you are doing good to others but are being treated unfairly in return, continue obeying Jesus! God is the One who will reward you for that obedience. Also remember while Jesus lived on earth He was treated very badly even though He was good in all His ways.
But love your enemies, do good, and lend, hoping for nothing in return; and your reward will be great, and you will be sons of the Most High. For He is kind to the unthankful and evil.