I am a senior scientiste and I faced the same problem until I discovered zettelkasten method.
Several tools implement this method. A famous web based one is Roam Research, but I personally use an emacs mode called org-roam. It allows for structuring notes with links and back -links, bibliographic or web references, web pages or images capture and a graphical notes constellation navigation. As it based on org-mode, it is also possible to insert code blocks (with a lot of accessible programming langages) which can be interpreted directly within emacs (there is a lot of documentation about this feature that toi could fond through a web Research on 'reproducible research').
Some people use a complementary mode wich works like Anki cards in order visit and memorize your notes on a daily basis.
I am a senior scientiste and I faced the same problem until I discovered zettelkasten method.
Several tools implement this method. A famous web based one is Roam Research, but I personally use an emacs mode called org-roam. It allows for structuring notes with links and back -links, bibliographic or web references, web pages or images capture and a graphical notes constellation navigation. As it based on org-mode, it is also possible to insert code blocks (with a lot of accessible programming langages) which can be interpreted directly within emacs (there is a lot of documentation about this feature that toi could fond through a web Research on 'reproducible research'). Some people use a complementary mode wich works like Anki cards in order visit and memorize your notes on a daily basis.
I hope it could correspond to your needs.