1) How can I use the phrase, "do right by"?
2) And what does it mean exactly when we say that?
3) Can I say, I hope they do right by me? Or I hope he/she does right by me?
If you're divorced and have children, you should do right by them and maintain a good relationship with your ex-spouse.
This means that by not fighting with the ex-spouse, you provide a benefit to the children. It often implies consciously taking a specific action (one you otherwise might not take) in order to bestow some benefit on a third party.
Yes, you can certainly follow do right by with an object pronoun or any noun.