Hi,
I read your query and can understand your distress regarding your condition. From what you have mentioned, it seems that you might be suffering from depressive episode. The symptoms of feeling depressed, lack of confidence and lack of attention and concentration are part of depressive episode.
The decline in academic performance can be due to the same reason.
Cognitive impairment is a term used to describe impairment in memory, attention, concentration, intelligence judgement, etc. It can be due to multiple reasons. In your case, the problem is
depression because of which you are not able to concentrate, which is manifesting as academic decline.
Your condition is highly amenable to treatment. I would suggest that you seek a psychiatric consultation. Treatment with anti-depressant medications like
sertraline, escitalopram is safe and effective. I addition, you can also start exercising daily which will help in your condition. Avoid any drugs or alcohol as well.
Hope this information was helpful. Best wishes.