B.G 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.
तदुपायमाह - कर्मजं इति॥ कर्मजं फलं त्यक्त्वा अकामनया ईश्वराय समर्प्य। बुदि्धयुक्ताः सम्यग्ज्ञानिनो भूत्वा पदं गच्छन्ति। संयोगकर्म ज्ञानसाधनम्, तत् मोक्षसाधनम् इति भावः ॥५१॥
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.