Krishna says that those established in brahman (absolute), having a firm understanding of divine knowledge and not hampered by delusion, neither rejoice in getting something pleasant nor grieve on experiencing the unpleasant (5.20). We label situations and people as pleasant and unpleasant and essentially, it's dropping labelling (2.50).
Krishna repeatedly tells Arjun to come out of the moha (delusion) which arises out of wrong identification of what is ours and what is not. The biggest delusion we have is that we can attain happiness through our senses. On the other hand, Krishna gives a solution for unending happiness when he says that those who are not attached to external sense pleasures realize divine bliss in the self. Being united with God through Yoga, they experience unending happiness (5.21).
Krishna cautions that the pleasures that arise from contact with the sense objects, though appearing as enjoyable to worldly-minded people, are verily a source of misery. O son of Kunti, such pleasures have a beginning and an end, so the wise do not delight in them (5.22).
This is the continuation of what Krishna said at the very beginning of the Gita (2.14), "The meeting of the indriyas (senses) with the external objects causes polarities of pleasure and pain and we should learn to tolerate them, as they are 'anitya' or transient." This implies that in due course of time, both pleasure and pain would come to an end invariably. It's our experience that we feel pain when pleasures go away or when we get bored of them. Similarly, we experience pleasure when pain goes away. To overcome these, we resort to a temporary measure of regurgitating the pleasure moments or resort to a blame game. But the essence is to be aware of the impermanence of pleasures and pains while we go through them.
Source - Daily World