In the same narration, Imam Baqir has interpreted "remember God in all states" in the following way: "He who remembers Allah the Exalted when committing a sin, divine remembrance stops him." Divine remembrance prevents people from committing sins - different kinds of sins, including lying, backbiting, hiding the truth, being unjust, insulting people, appropriating what belongs to others and to weak people and treating other people in a careless way. These are different types of sins. In all these things, one should pay attention to God. One should engage in divine remembrance in order to avoid these sins.
"... and divine remembrance comes between him and the sin and this is the meaning when Allah the Exalted says, 'Surely those who guard (against evil), when a visitation from Satan afflicts them, they become mindful.'" Imam Baqir (a.s.) says that this is the interpretation of the ayah which says, "Surely those who guard (against evil), when a visitation from the Satan afflicts them, they become mindful." [The Holy Quran, 7: 201] When Satan visits them - that is to say, when Satan has not yet permeated their entire being - they immediately remember God. "... and then they see." This divine remembrance opens up their eyes and makes them insightful. This is the meaning of "remember God in all states."
Ayatollah Khamenei , the supreme leader of Islamic revolution of Iran, Sep 22, 2007