How to Live Righteously?

What did these great Arahants, who also used to suffer from obsessive thoughts like us, practice to think wisely and live blissfully?

Mindfulness on the Impurities of the Body

Impurities of the Body or the Asubha Bhavana helps us immensely in recognizing and understanding topics such as impermanence, as well as in controlling lust and attachment towards the body.