You should thoroughly back up your Mac machine to upgrade to macOS 14 without losing data. You can back up your files to an external hard drive or upload them to iCloud. Data recovery software will come in handy when you don't have any backups.