“Karmanye vadhikaraste Ma Phaleshu Kadachana
Ma Karmaphalaheturbhurma Te Sangostvakarmani “
This is a famous shloka from Gita. This message was from Lord Krishna to Arjun during the Epic War of Mahabharat when Arjun was not willing to fight. Lord Krishna explains to Arjun to perform his duties. No matter what is the result of the war. His duty is to fight; then he has to fight. Krishna advises Arjun that he is not supposed to worry about victory or defeat. He must keep on performing duties without being attached to the results of actions.
This verse tells us to perform our duties without being attached to the outcomes of the actions. Hence, the purpose is important, not the outcome.