God i want that so much. Is what i always did, still do when i use Notion and what i miss most about OneNote.
Some hackways of achieving something close to it would be tables or a fold (bullet point or headings, with the settings set to fold then), but wouldnt be the same. A 2 collum table can work but it would squeeze both contents (and would require part of the main text to be inside of the table). Making a bullet point for folding you could write the sidenote bellow it, and it would be hideable (folding the bullet point).
+1 for a snippet that helps with that, or a theme, anything