I am an old-school writer without fancy software (I have tried it and don't like it).
So if I realize a previous event could have been explained better, I will back up and do it. However, I have a special notation in my writing; "NOTE:", and I will usually record one at the point I am NOW and what is going on, before I jump.
If I have an idea for the future, same thing: I keep some pages at the end of the file that contain NOTE:. I try to keep them in relative order, so the most relevant notes coming up are at the top of the list. I will just go add a note to the end, make it as long as I want, then jump back to where I was.
I regularly search for "NOTE" in my writing, usually if I am starting a new chapter, I review my notes to see if any apply.
I have other NOTES in there, sometimes just things I want to remember about a character or her history. Otherwise, if the NOTE is a reminder to write or do something, I delete when it is done, or I decided against it, after all.
Separately I keep a sheet of paper for notes on a map or geography when that applies, whether my setting is a single town, or a whole world. I don't generally do a detailed map before I begin writing, just a rough sketch. I am a discovery writer, so I don't start with a plot and I invent setting locations as I go -- but I want them to remain consistent, and there is no good way to do that in writing, I need a map. So I fill that in, as I go, too.
It's kind of like a messy desk with a lot of post-it notes, but it works better than that for me, because I have a search function!
Some editors will allow you something just like a post-it note in your draft, but I tried that and had difficulty searching them for some reason. (The reason was probably incompetence.)
If you don't really want to buy or learn a new tool, just keep your notes in the text you are writing, with some LABEL you can search for, that is unlikely to appear in your novel. Then you can indulge yourself with being sidetracked; just leave yourself some chalk marks on the walls of the maze so you don't get lost, and make sure you delete them all when you are done.