Boredom has been my biggest enemy since I can remember.
It is the main thing that can turn me from a productive person who focuses on making as much progress as possible in the most efficient way into someone who does nothing except watch YouTube and play League of Legends week after week.
I had to fight boredom several times to keep on doing some of the things that I like.
Sometimes I fight it with sheer willpower, going through all the stages of boredom without paying too much attention to it and trying to discipline myself enough to just do what must be done.
Sometimes I give up on something I used to like and I try something new, which will become boring in a few weeks or months. I usually consider this to be a defeat.
Other times I try to get some motivation, either by looking at great things that people do within the same area that I'm interested in, or by imagining the great things that I could create in the future if I can keep myself from giving up.
Regardless, it's hard to deal with boredom. It's hard because I get bored of most things very quickly. It's not that I don't truly enjoy them, because I do. But they simply lose that initial attractiveness in time. I've experienced this with coding, graphic design, writing, drawing, and a lot of other things.
Recently however I discovered, through reading the works of people much smarter than me, that boredom is absolutely normal and that you can keep it away if you are diligent enough about your current skill level in the area you are interested in and the type of work you're trying to do.
If your skill level is too high, and the work you do is too easy, or too repetitive, and doesn't challenge you in any way, shape or form, then there's a big chance that you'll get bored of whatever it is that you do. This is quite obvious, but so are a lot of other brilliant ideas that we simply don't think about until someone tells us about them.
If the opposite is true, then frustration might make itself comfortable in your soul. If your skill level is not high enough, and the task you need to do is too complicated, and requires knowledge you don't have or even worse, knowledge you don't even know exists, then you might quickly get frustrated and be more likely to quit.
So what's the solution?
Balance, as usual.
Within the area that you perform, try to find a balance between work that is hard enough to challenge your current skill level, but not so hard as to frustrate you into quitting.
In my case, there's several things I can do regarding the activities that I am interested in.
When it comes to 3D modelling I can always try to build something bigger or more complex. Instead of building a room, I can build a house. Instead of building a house, I can build a town. Instead of a town I can build a city. With each step up in difficulty I can also add extra things that I must do, such as increasing the level of small details. A mistake I can make is trying to do something that I have no knowledge about in the hopes of achieving something great, such as creating a human body in Blender when I know nothing about the human anatomy.
When it comes to writing, I can approach topics that I don't usually talk about, such as philosophy, something I did quite a lot in the past. Talking about my current changes in workflow, like switching operating systems and making Pop!_OS my main working environment is also something else I wrote about did in order to change the subjects I usually approach. The mistake here would be trying to write something like a book, which is far beyond my level, which will frustrate me and maybe make me quit writing for a while.
I also started getting bored of Python again recently, but because I now know why, I quickly made a change to avoid boredom. I used a book called "Head first Python" to remember some of the basic principles of Python, but the book was too easy since I already knew a bit about the language. Once I noticed that I started avoiding the book and procrastinating, I stopped reading the book and started looking for more difficult things to do. Starting to work on something huge, such as a some AI project or a custom OS, would easily make me quit programming since that's way beyond my skill level, so I must find projects that are not too easy, but not too hard either.
The examples can keep on going, but you get the point.
Boredom has always been and will probably always be my biggest enemy, and I have and probably will keep on finding new ways to fight against it. Currently, this balancing effort works, and I hope it will allow me to keep on doing the things I like without ending up quitting out of boredom. It might also be something you can try for yourself, in case you find something in your life that you enjoy that starts to lose its attractiveness.