I take notes at work mostly where we use confluence for all the documentation. Confluence was slow so I tried local plain-text apps including Typora, Obsidian etc. and abandoned them quickly because I couldn't easily link to confluence documents. And if I am trying to write a new document, its not easy to dump thoughts in these tools.
Tried confluence again and while it allows copy pasting images etc. its hard to format code, its very slow to modify something and again its hard to dump your thoughts in a confluence document in a hope to refactor into final document in multiple iterations.
OneNote is what I have settled on finally. New OneNote design silly like all new Microsoft software https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-move-onenote-sections-back-to-top-of/4db9afb6-e8fb-49aa-b374-d357bd9b75f1 Every page is like a free-form white board on which you can write or draw or paste images anywhere. Also, the text in screenshots becomes searchable. I was on a complicated task recently for past few months and OneNote was a huge help. I made a section dedicated to my task. Then made pages freely as I needed in there e.g. a page for architecture I was trying to figure out, another page for things i tried to test memory usage, a page for configurations etc etc. Least resistance to put the idea down is very important and I couldn't have managed all this information without OneNote this easily.
You cannot write the final document in OneNote though. It's not built for that I think. But its a great assistant to jot your ideas down somewhere. I don't think there is anything else as flexible and as resistance free to dump information while still keeping it manageable. Give this a try if you can.