When you're up to your neck in alligators, it's hard to remember that your initial objective was to drain the swamp
ā Proverb of unknown providence
Do you remember that episode of Malcom in the Middle where Hal has been asked to change a light bulb but when he goes to do so the draw breaks and then in order to fix the draw something else needs fixing which requires he drives to a store and before long he has the car in pieces trying to fix a check engine light ā that's Yak Shaving.
According to the Wiktonary entry for Yak Shaving the phrase was coined by Carlin Vieri in his time at the MIT AI Lab (1993ā1998) in reference to a 1991 episode of The Ren and Stimpy Show featuring a segment named "Yak Shaving Day".