If you have some things on your mind - write them down. Your brain has a limited capacity to keep things alive. Besides, it takes energy to keep things around. So your brain will start shedding away some "irrelevant" details anyway.
By writing things down, we preserve them on a more durable medium. Paper or files are a cheaper form of storage than our brain (energy-wise).
When we write things down, we permit ourselves to forget things. The unburdened mind could then give complete attention to the task at hand.
I found out that I could work with 5-6 projects during the day without feeling too stressed (2-3 is the comfortable zone). The only trick was to treat me as a very dumb goldfish and write things down in a journal as soon as possible.
This way, at any moment in time during the workday, I'll have most of the brain capacity free for focusing on the task at hand.
Notes don't have to be verbose. A short sentence and a chat screenshot can be all it takes to get current context out of my mind and switch to a new task with full dedication.