If you have a Time Machine backup, then you can connect the TM backup drive, click "Enter Time Machine" in the TM menu bar icon, and navigate to the desktop folder where the notes were and restore them.
Restore items backed up with Time Machine on Mac - Apple Support
iCloud is not a backup solution. It's a way to sync and share files and folders between multiple computers and iPhones & iPads.
If you use iCloud Drive, you may find your notes folder (and other desktop files and folders) are resident on your iCloud Drive.
Access and manage your files in iCloud Drive - Apple Support