People tend to treat others the way they have been treated themselves.
People do to others what people have done to them.
この場合、次のような言い方ができますよ。
ーPeople tend to treat others the way they have been treated themselves.
「人は自分が扱われたのと同じように他人を扱いがちだ」
to treat で「扱う・取り扱う」
ーPeople do to others what people have done to them.
「人は自分がされたように人にもする」
このようにも言えます。
ご参考まで!