when you're up to your neck in alligators, it's hard to remember that your initial objective was to drain the swamp

Proverb

 * 1) It is easy to lose sight of one's initial objective, becoming caught up in subtasks or in tasks only tangentially related to the original goal.

Usage notes

 * Numerous variants exist, using other body parts ("eyes", "ears", "ass"/"arse", "ankles", "armpits", etc) in place of "neck" and replacing "initial objective" with just "objective" or with "mission", "goal" etc.