In case someone else feels the same way, what worked for me is to talk to my coworkers. I usually go out for coffee or long walks and let my mind wander. I'd talk about work, politics, our families, and usually the conversation wanders back to work and what we are doing.
Many scenarios usually come up from those talks. Sometimes I'll find what my coworkers working on pretty interesting and get involved (which sometimes makes coming back to my work easier). Sometimes I ended up talking about my work (explaining my problems to others helps me clarify and solidify what I needed to do). Sometimes I realize that another team has already done the work and all I have to do is ask them for a library. Once I realize that my work was meaningless and purely a political play and I left the company soon after.
So going out for long walks and just talking with different people in my company has worked out really well for me.