Evenize your mind towards sukha and du:kha, gain and loss, victory and defeat, and then engage in war. Thus you will not incur sin.
Having exposed the spiritual and secular aspects of the whole subject, Krishna summarises the Sankhya (wisdom) teachings, focussing their application to the battle front, something not found in Vedic Upanishads.
Sukha-duhkhas are the only resultant of all sensory interactions, which constitute the world and our life alike. With both inevitable, nothing needs to be done to have them or not to.
As without duhkha, sukha cannot be, duhkha is not undesirable. And as sukha is always followed by duhkha, it is not specially desirable either. Be equal-minded to both.
This even-mindedness is applicable to all events, situations and ventures. Krishna mentions an assortment of these: Gain and loss in one’s field of activity; victory and defeat invariably met by all. All these, despite their nature and relevance, result in sukha-duhkhas alone. This mental duo becomes the sole focus of spiritual sadhana.