Re the part about the brain associating how you feel at the moment / how you think you are performing with how you judge yourself as a person: I recommend reading Steve Hayes work / ACT therapy including this video for acute distress episodes
https://youtu.be/GnSHpBRLJrQ . TLDR is learning ways to keep your thoughts and feelings separate from your sense of self.