Hi kanasi. Some ideas:
-Scheduling work periods and breaks, like you were thinking, is probably a good idea. Timers can be helpful. I usually do short blocks: 10 or 15 min of work followed by a 5 min break, sometimes other block lengths if I'm actually managing to get things done. You'll have to experiment and see what works for you as to time lengths of work/break periods.
-Maybe try getting active on your breaks. Get up and get your heart pumping--do jumping jacks or run up and down some flights of stairs for 5 minutes on your break, then return to work.
-You said "It also gets much worse if I try to concentrate on a serious task." I've found that if I'm anxious about something or if it seems to big, I experience more fatigue. Break your task down and write out the chunks of work to do. Sadly, I haven't really been able to break things down, but maybe you'll have more luck!
-Sometimes being hungry or thirsty can increase mental fatigue. You could try to see if more frequent small snacks would help
-Maybe see if you can find something interesting to you in the task you're trying to do, or try putting yourself in a curious mindset and asking questions to yourself about it (if it's schoolwork).
I think the first two I listed are the most likely to be helpful. I hope that you discover some strategies that work for you. Good luck!

(And if you find something else that really helps, please come back and share haha)