It may be helpful to find aspects of your work that are the "least bad" parts and develop your skills and position in that direction. I found that focusing on the least bad aspects did help me stay in a job that represents "underemployment" for me.

If you are still in an early- to mid-career stage of life, you may be able to re-train or supplement your training to switch to a career with more challenge. If you can't switch, I'd recommend developing truly challenging hobbies. Some examples of challenging hobbies: There's a group of Japanese "white hat" hackers that joins together and cracks crypto-currency theft cases after work. There are adults (and younger people) that play in bridge, chess, and poker tournaments. There are people that organize and volunteer at "repair events" and "repair cafes" and fix everything from electronics to clothing. There are lots of musicians playing for free or very little money in combos, bands, and orchestras. All of these groups are primarily people challenging themselves after work.

To join in with an earlier statement, this is kind of like after-schooling for adults. Learn, grow, keep busy, while not relying solely on work/school to meet all your needs and still acknowledging that work/school is necessary at this time for you. Isn't this why we sign the kiddos up for computer camp, math camp, and music lessons etc.?