If you need to work on several projects at once (as is often necessary in the real world), then do it by creating and maintaining a clear separation between them. A separation both of time and attention.
Besides scheduling different projects at different times, do things related to neither project in between so your attention to the earlier project doesn’t carry over. This is an ideal time for routine maintenance/chores. Check email, do the dishes, go grocery shopping, take lunch; to the extent that you need to think about something other than the immediate task, think about the upcoming project, not the one you just left. Then go to work on the second project with your attention on the first broken.
If you need to work on several projects at once (as is often necessary in the real world), then do it by creating and maintaining a clear separation between them. A separation both of time and attention.
Besides scheduling different projects at different times, do things related to neither project in between so your attention to the earlier project doesn’t carry over. This is an ideal time for routine maintenance/chores. Check email, do the dishes, go grocery shopping, take lunch; to the extent that you need to think about something other than the immediate task, think about the upcoming project, not the one you just left. Then go to work on the second project with your attention on the first broken.