My favorite note-taking software is CherryTree, but at work I use OneNote if installing new software is against company policy. Ultimately what I want is pages of plain text which are organized in a tree structure.
As a part of my work I make notes regularly. Each new task gets a new page: it starts with a link to Jira and a copy of task description; followed with all task-related facts I found, questions I want to ask/explore, etc. The purpose of this is to be able to continue if I get interrupted or on the next day, because my memory sucks. Sometimes I use writing as a form of rubber duck debugging. After finishing the task, the page is moved into a "completed" folder (sometimes organized by year and month) and typically not edited anymore. As a side effect, it allows me to provide an occassional summary when someone asks what I have been working on this year.
In addition to that, I also have a topic-oriented hierarchy. The top nodes are "company" for information about company in general (processes, colleagues...). A top node for each project I am working on (data model, API...). The last top node is "knowledge" (useful pieces of information about programming languages, frameworks, and tools). This information is updated when I learn something that seems useful, and referred to when I need to remember something I know I made a note for. I do not aim to have a complete documentation of something (that would take too much time) but rather to cache everything that I already spent time to find out.
(Sometimes my colleagues object when they see me making private notes. Like, why don't I update the company wiki instead? The answer is that my private notes are allowed to be idiosyncratic, incomplete, low-status; and I am free to use the most convenient tool for the job. Writing for others using tools selected by others is more than trivial inconvenience -- waiting a few seconds after clicking each button, fighting with the formatting... That said, yes, I also contribute information to the company wiki once in a while.)
At home, the top nodes in my hierarchy are "to do / planning / projects", "finance", "various know-how", "mathematics", "computer science", "programming", "useful software", "games", "books", "internet"...
I am using this kind of system for several years. Previously I tried to develop my own software (Notilo) optimized for my personal quirks, but it was quite lame, and when I had kids it became impossible to maintain it, so I switched to CherryTree. Unfortunately, I have a lot of notes in the old format, which I hope to convert (probably by manual copy-pasting individual pages) one day.
What role does note-taking play for you? Is it a way to focus your attention? To make extracts from the text for easier reference later? To comprehend the material better through the act of making notes?
All of the above, with different parts of the system optimized for different purposes. Generally, there is a "diary" part and a "reference" part; the former helps me focus on something at short term and sometimes serves as a log in long term, the latter allows finding things easily later.