Too much, over-stimulation, and you’ll find your focus being pulled in multiple directions to a point of confusion, frustration and anxiety. I believe this can also lead to migraines.
In that situation you have to reduce something, maybe it’s ambient noise, maybe you need to pause your music, maybe you need music without lyrics. Maybe the lights are too bright. Maybe you have too much on your plate. Or, maybe your chair is hurting your back, and you need to replace it.
To little, under-stimulation, and you need to find the right type of stimulation to aid your brain. For me, lyricless music, is perfect for deep thought coding. But not enough for washing the dishes or cooking, a conference talk or similar however is great.
You may need meds (talk to a Dr/Psych), or maybe just some tea/coffee.
Exercise can help. You can get an under desk treadmill, and walk even at a gentle pace for a few hours to keep your brain active and alert.
You have to experiment and learn what _your_ brain needs. It’s not quite the same for everyone. What works for me, is often the exact opposite for others.
And remember how much sleep, what you’ve eaten, and how well defined your task is all contribute.