my way to approach this, be it for my hobby or corporate projects, is to always associate a TODO with a ticket/issue number (in github/redmine/jira/whatever) so that I can remember them, and/or include them in a sprint (in my company I always try to include one or two "fix todo" issues in our sprints)
It also helps teammate who find themselves with 1 hours idleing to have a little thing to do.