In ancient times those desiring liberation performed actions understanding the transcendental nature of the Lord. If one is impure in heart, recognizing this and wanting to change, one should perform actions to purify the heart by being unattached to the results of work. This leads to jñāna. If one is already pure in heart, one should perform actions to teach others. One pure in heart will not be egotistic but will be able to see the self separate from the body. Such a person continues to perform actions to teach others. Kṛṣṇa encourages Arjuna to fight for Kṛṣṇa’s pleasure, in knowledge of Kṛṣṇa’s position and as an offering to Him. Arjuna is here advised to act in Kṛṣṇa consciousness, following in the footsteps of the Lord's previous disciples, such as the sun-god Vivasvān.
The whole theme of Bhagavad gītā is to encourage action without artificially giving it up in the name of sannyāsa. Bhagavad gītā urges everyone to perform actions without being attached to the results (niṣkāma karma), in order to teach others and ultimately as an offering to Kṛṣṇa.