What does contemplation mean and how should we do it? And how can we be aware all the time?

When you want to do an an action think if the action would be pleasing to Allah or not? Would the prophet or Imam approve if he was in our presence?
We should keep them in our mind and thoughts