A few open-source options that need no account:
- Joplin: notebooks and notes stored locally, with sync optional (your own WebDAV or Nextcloud, or a folder). There are apps for desktop, Android and iOS. The most straightforward swap.
- Trilium Notes (now developed as TriliumNext): a deep tree of notes, which comes closest to OneNote's notebook/section/page feel. Desktop app, or self-host it.
- Xournal++: if you used OneNote mainly for pen and handwriting or for marking up PDFs.
What none of them copy is OneNote's free-form canvas, where you click anywhere and type. If that's the part you'd miss, try Xournal++ first.