Actions Are Judged by Intentions
Reference: Sahih al-Bukhari 1
إِنَّمَا الأَعْمَالُ بِالنِّيَّاتِ وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى
English meaning
The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended.
Key lesson
Every action is judged by its intention. Sincerity is the foundation of all good deeds.
Practical application
Before any action, renew your intention to do it purely for the sake of Allah.