Just because we have been working at home, thanks to the turns of events that happened in the world in the last year, and have more freedom doesn't mean we have to neglect our wellbeign. Here I'll modify a very famous quote and say: "With great freedom there must also come great responsibility".
What you'll read next are some tips that might help you pass throught your day without feeling (that much) tired by the end of it.
Don't just sit in front of your screen and type like a hollywood 'hacker' until you're done. Make a plan, put a time to each task and commit to it. And inside it put spaces/blocks to eat (outside of your desk/work space, and something healthy), rest, etc. If you're not used to it, it might take a while, but afte a while you'll adopt the routine and you'll feel more accomplished.
No s**t Sherlock. Yeah, this might seem a little too obvious.
You can use whatever technique you find (Pomodoro being the most popular), but it mostly boils down to: Work for X ammount of time and take a break for Y ammount of time, while X > Y (in Pomodoro it's 25:5, then, after four 25 min tasks, take one 25-30 min long break).
This can be as simple as go outside and take a walk through your neighborhood or nearby park (if your country's lockdown laws allow it) for at least 30 minutes. If not, you can search online for any home workout routine and do it.
Close the editor, minimize/close your work related tabs. Here you can do something else in your computer (watch a series/movie, play a game, etc.) or walk away from your desk, go to a walk (if your lockdown restrictions allow it), clean your room, etc. That way you can focus on something else and do a soft reboot of your thoughts.
Don't feel like doing an extensive load of work/code? Do it for a short period of time, like 30 minuntes, and do something else. And, if you made a breakthrough and feel like it, keep going! Nothig beats the joy of finding your code is working after hitting your head with the issue for quite a while.
If you like to work while listening music to anything else, do it! Find a genre that you're comfortable with and play it. Have in mind that if your living with somebody put some headphones (at a healthy volume, of course) or use you speakers at a tolerable volume.
And that's it. If you have another tip, you can share it in the comments.
Thanks for reading, and have a nice day!
P.S.: If the issue is bigger than just feeling tired, I'd consider going to a professional. I've just written what's been working for me and felt like sharing to see if it helps.