Another trick is to break down the task into as many subtasks as you can, and when you’re feeling obstinate about working, just get one small subtask done. It also helps you visualize the finiteness of the total pain you have to endure.
There’s basically no way to be intrinsically motivated about tedious, pointless-feeling work, but you can connect it causally to the overall success of your project, which presumably you do care about.
If it's very cold outside, you tell yourself 'if it's too cold after 10 minutes I'll come back in'. But you never come back in. It's a matter of getting started, nothing else.
We are funny creatures.
I used to always want to quit running ASAP, and the feeling just didn't go away whether I ran for five minutes or an hour. Fast forward some years, I'd gotten into cycling, enjoyed my rides and was in a much better physical condition. I also had a heart rate tracker and was used to training with heart rate zones. So one time I went for a run, first time in years, and tried to stay in the <60% HR zone. I started at my normal speed, realized my heart is racing, slowed down and eventually realized that even at my slowest possible running speed I'm going over my heart rate target. I had to settle for alternating between very slow running and walking to keep the exercise level light. Of course, after a couple of "runs" i could keep up better, but still running at any kind of speed is hard exercise for me.
I gather this is a common phenomenon, and most beginners run way too fast.
I keep a separate list of "dumb little things" to fix that don't require much thought or effort. I'll grab something from that list, which makes it easy to start; then once the editor is open I start getting into the zone.