I know what you mean about being lost and sidetracked.
I have been there so many times earlier, starting with game mechanics and then after a while focusing too much on game graphics, ending up mixed up and ditching a project all together.
What I suggest is to take notes, on the progress regarding code. You can make bullet points and divide bigger objectives in smaller ones.
Also I would focus on the core mechanics of the game first, put box place holders instead of proper sprites.
As for the graphics, do some sketches beforehand, nothing really fancy, collect any inspiration that would suit your direction into a folder, and just look at it during quick breaks from coding.
Once the core mechanics are down, then start to dabble with the graphics.
As for sound, I would really focus on that at the very end, unless your game mechanic is a unique and different one.
I find choosing sounds and music comes more naturally when I load up my game, play a sound in the background and just test play.
Working on everything without a plan, can overwhelm a person. Perhaps you could make yourself a timetable, when to work on code and when to work on graphics or even sound.
That being said and taking into consideration that different people have different workflows, this is just some info I gathered from my experience and I hope that answers your question at least somewhat.