The way to make boring tasks more appealing is actually very simple. All you have to do is remove other factors that might be more fun or interesting. These factors can then be used as rewards for when you achieve your personal goals.
To make this transition easier, it is recommended to do somewhat of a mental detox, where you choose certain activities that you will completely avoid for a period of time. This can be reading light novels, reading manga, playing video games, watching anime/shows/movies, wasting time browsing social media platforms or reddit, etc.
Setting goals with rewards is also a very key aspect of this. For example: every 2 hours I ..., I get to read 2 chapters of my favorite novel.
To maximize your attention, you should also regularly take short breaks during sessions. A good starting point is once every half an hour, but this is heavily dependent on preference. You'll be able to tell when your concentration starts waning and that's the point where you should take a ~5 minute break to clear your head.