Intentions First

The Prophet Muhammad ﷺ said:

Actions are but by intentions, and everyone will have what he intended. So whoever migrated to Allah and His Messenger, he migrated to Allah and His Messenger. But whoever migrated for some worldly benefit, or to take a woman in marriage, then his migration was only to what he migrated to.

Al-Bukhāri, Muslim and others.

Also read

Related sayings.