Take a step back!
I don't even know how many times I was just not in the mood to do a job that was too dull or too boring, too complicated, or too something for me to want to do it.
Mainly, what generates my mental blocks are related to database work, I generally dislike working with databases, SQL or anything in that general direction, so every time I have to do some project that relies on databases, I go on a tangent, start finding cool new ways of not having to really touch the database.
I did this quite recently with a project where I am the one responsible for creating Business Intelligence Cubes for our call center performance report.
The way out is to take a step back, do a different project if you have to, something you like, this will give you some energies/enthusiasm to spend on the assignments you care less about.
So my advise mainly consists of taking your head out of the problem at hand, to have a different approach:
Take a step back, stop doing the horrible thing you don't want to do for a while
Talk to someone about how much you dislike/don't want to do it, hearing yourself whine will put you off your own lack of willpower and kick you into action
Finish the other project (there is always one) that you didn't finish before and its just lying there making mental clutter
READ, reading about the problem, (not just googling for a solution) but really doing some proper reading, again, not just filtering and searching for the direct solution, but reading:
In my case, I read books by people who like databases and SQL, from beginning to end, sometime in the middle I will feel like I don't hate the damn thngs so much any more, and better yet, the problem as I was seeing it before, is actually something covered in 101 basics xyz, pet talk near the Introduction of those books.
We all feel your pain :^)