B.G 2.51
karmajaṁ buddhiyuktā hi phalaṁ tyaktvā manīṣiṇaḥ। janmabandhavinirmuktāḥ padaṁ gacchantyanāmayam ॥2-51॥
The great achievers perform actions possessed with the right knowledge. Relinquishing the results, certainly they become free from the bondage that causes birth and reaches the ultimate goal without difficulty.
Gīta Bhāshya 2.51
Action performed with the right attitude leads to knowledge, that in turn leads to liberation. Relinquishing the results means offering it to the lord.
tadupāyamāha - karmajaṁ iti॥ karmajaṁ phalaṁ tyaktvā akāmanayā īśvarāya samarpya। budidhayuktāḥ samyagjñāninō bhūtvā padaṁ gacchanti। saṁyōgakarma jñānasādhanam, tat mōkṣasādhanam iti bhāvaḥ ॥51॥
The solution is elaborated by 'karmajaṁ' verse. Perform actions without desire and relinquish the fruits of action by offering them to the lord. 'budidhayuktāḥ' - becoming perfectly knowledgeable one attains the goal. "Action performed with the right attitude leads to knowledge, that in turn leads to liberation" - is the intended meaning.