Dharmo rakshati rakshitaha. Save righteousness; Get saved by it.

Dharmo rakshati rakshitaha.
One who destroys Righteousness is destroyed by the very force of Righteousness, and One who protects Righteousness is protected by it.
Westerners quoted it as "You get what you give, whether it's bad or good".

Read, Why Ramayana and Mahabharata are so popular among Indians?
Why Good always triumphs over Evil?