Well in simple words if you follow teachings of the Gita what you need to do is to detach yourself from all such activities/actions.
Many people insulted Kabir/Guru Nanak/Buddha/Mahavir but where are those people now and where are these enlightened beings? Failure in exams or becoming an IPS/IAS is just part n parcel of this journey, just live in the present, enjoy the moment and move on. Life or time just like a river never stops for anyone. You can not get attached to these activities for ever.
There is very famous verse from Gita that says:
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन । मा कर्मफलहेतुर्भूर्मा ते
सङ्गोऽस्त्वकर्मणि ॥ ४७ ॥ Bg. 2.47
Translation
You have a right to perform your prescribed duty, but you are not
entitled to the fruits of action. Never consider yourself the cause of
the results of your activities, and never be attached to not doing
your duty.
Quoting few other verses from Gita:
श्रीब्राह्मण उवाच परिग्रहो हि दु:खाय यद् यत्प्रियतमं नृणाम् । अनन्तं
सुखमाप्नोति तद् विद्वान् यस्त्वकिञ्चन: ॥ १ ॥ - ŚB 11.9.1
Translation
The saintly brāhmaṇa said: Everyone considers certain things within
the material world to be most dear to him, and because of attachment
to such things one eventually becomes miserable. One who understands
this gives up material possessiveness and attachment and thus achieves
unlimited happiness.
जायापत्यगृहक्षेत्रस्वजनद्रविणादिषु । उदासीन: समं पश्यन्
सर्वेष्वर्थमिवात्मन: ॥ ७ ॥ ŚB 11.10.7
Translation
One should see one’s real self-interest in life in all circumstances
and should therefore remain detached from wife, children, home, land,
relatives, friends, wealth and so on.
यदा चित्तं प्रसीदेत इन्द्रियाणां च निर्वृति: । देहेऽभयं मनोऽसङ्गं तत्
सत्त्वं विद्धि मत्पदम् ॥ १६ ॥ ŚB 11.25.16
Translation
When consciousness becomes clear and the senses are detached from
matter, one experiences fearlessness within the material body and
detachment from the material mind. You should understand this
situation to be the predominance of the mode of goodness, in which one
has the opportunity to realize Me.