When you renounce your attachment, there is nothing to shake you. It is the feeling of possession, of clinging, that disturbs the mind.
Dedicate your life in the name of God or humanity, and your mind will always be clean and calm. You will reflect your true nature always. That is the goal of all the different paths: to keep the mind clean and calm.