Sleep is number one. Without it, you will think much much slower. When you are deprived, parts of your brain shut off and 'rest'.
Once that's taken care off, stimulant is another way. Coffee in general is a widely accepted way to accelerate thinking.
As some people mentioned, general anxiety or fear/emotion could impact thinking both positively and negatively. A healthy dose of cortisol could improve performance but too much of it especially if you get into panic/terror mode would impede fast thinking.
Fasting once you past through the low glucose phase could actually help assuming you are not one of those who are plagued with persistent brain fog due to lack of fuel during a fast.
Toxic load matters. If your body chemicals are out of whack or intoxicated it might cause brain inflammation which would impact your thinking.
But more importantly the baseline is genetics - how your brain is wired really matters. The amount of grey matters & glia along with the unique way your body myelinate connections impact how fast you could think.
Nootropics - could help to a certain extend but they ALL have side effects, some permanent so I don't recommend them.