yak shaving
noun
°Any apparently useless activity which, by allowing you to overcome intermediate difficulties, allows you to solve a larger problem.
"I was doing a bit of yak shaving this morning, and it looks like it might have paid off."
°The actually useless activity you do that appears important when you are consciously or unconsciously procrastinating about a larger problem.
"I thought I'd get more work done if I just fixed a problem with my .emacs file, but then I spent the whole afternoon yak shaving."