For exporting to PDF, I have had some success with Exporter
https://apps.apple.com/us/app/exporter/id1099120373 But I wouldn't be confident that all notes would export to PDFs accurately. Try it.
The difficulty is that Notes uses a database. Backing up of the whole database using Time Machine works well. And restoring is fine if you need to restore ALL your notes. A complete fail if you need to restore a note you deleted a week ago. To enable a robust backup and restore of individual notes requires export of each note to a format which can be reimported without loss - that does not exist (please, someone tell me I am wrong).
I now only use Notes for fairly ephemeral notes. I prefer to use a note writing app that a) keeps each note as a separate document, and b) in a format that be read (and preferably) written by alternative apps.
To meet those requirements, I use markdown format for notes with each note in a separate file. As an App, I use Typora. But there are lots of other apps which can read and edit documents in markdown format.
Consider moving away from Notes as your note taking app to a markdown editor.
Edit: Looked again at the spec for the current version of Exporter. It can export notes from Notes to markdown or html. That makes it even more useful.