For local notes, the Notes app stores everything in...
~/Library/Group Containers/group.com.apple.notes/
In this folder you'll find local Notes preferences stored in a subfolder in /Library/Preferences/group.com.apple.notes.plist. Many of the settings in this .plist file are private to Apple and may or may not be modifiable.
Some, but not all cached note thumbnails are also stored in the ~/Library/Group Containers/group.com.apple.notes/ folder, but in a /Thumbnails/Recent folder. A .png and a .json description of the thumbnail are stored here.
Notes removes these thumbnail caches at times it sees fit, but which is undocumented.
A much larger thumbnail cache is also stored in ~/Library/Group Containers/group.com.apple.notes/ but in the /Accounts folder in a folder with a UUID as its name. This folder contains a folder named "Previews", which in turn contains .png files, each named with a unique UUID generated by Notes.
This folder can get quite large and it's not clear the logic Notes uses to empty it when you delete individual notes in the app. To save disk space you may want to go through and manually clean out ancient files that are no longer used.
Also in the same /Accounts subfolder, is a folder entitled "Media". This is where Notes stores any items you may have pasted into your individual notes: large images, videos, links, and other items.
The logic Notes uses for clearing this folder is also not documented by Apple.
There is another subfolder in /Accounts, named "LocalAccount", but oddly not much ever seems to be stored here - local or not. iCloud items and media are never stored here, but to date, we've not seen anything from local individual notes stored here either, no matter how long they've existed.
The local database
In ~/Library/Group Containers/group.com.apple.notes/ you'll also see several lock files which are used while Notes is running, and which are deleted or unused when it's quit. There are a few other files and folders such as state, database backup files, and temp files. You can ignore most of these.
But the really important file is named "NoteStore.sqlite". This is a local SQLite database file, which stores all the notes and info associated with them. SQLite is an open source standard and the NoteStore.sqlite file can be viewed with any database app which can read .sqlite files.
Easy-to-use free SQLite viewer apps include Liya, DBeaver, and DB Browser for SQLite. If any of your notes are protected by passwords you'll need those passwords to be able to view the databases.
Most of the info in the database file are merely references back to the media on disk, and so it may take some searching to find what you're looking for.
https://appleinsider.com/inside/macos/tips/how-to-recover-notes-stored-on-your-mac
~ tilde indicates your user library folder
Apple hid the Users' Library folders...
Method 1:
- From the Finder, select the Go menu at top of the screen, and choose Go to Folder.
- In the window that opens, enter ~/Library/Group Containers, and click Go.
Or…
Use the Command-Shift-.