Hey there!
If you use Internet Recovery mode to erase your Mac using Option-Command-R at startup, your Mac should offer to install the latest supported version of macOS for your Mac, which in your case is macOS Ventura. However, before proceeding with an erase, you can verify Internet Recovery is indeed offering Ventura by looking at the "Install macOS [version]" app.

Before erasing your Mac, be sure that you have a backup of your Mac using Time Machine, or if you do not want to migrate all your files, verify your important files you want to keep are stored elsewhere, such as on an external hard disk. You could also create a bootable backup of your Mac using a third-party utility such as Carbon Copy Cloner, so should you need to access your Mac in the exact state it was in with Mojave, you can.
Once you have a backup of your Mac, you can erase your Mac and install macOS Ventura.
- Start up from macOS Recovery: Turn on your Mac, then immediately press and hold these three keys until you see a spinning globe: Option-Command (⌘)-R.
- From Recovery, verify your Mac is connected to a Wi-Fi network using the Wi-Fi menu in the top right of your screen.
- From the utilities window, select Disk Utility and click Continue.
- In Disk Utility, select View > Show All Devices. Then, look at the top of the hierarchy in Disk Utility. If you see an entry titled "Fusion Drive", select the "Container" entry right below it. If you see "APPLE SSD...", select it.
- Now, on the selected entry, click "Erase", and enter the requested details:
- Name: Macintosh HD
- Format: APFS
- Scheme (if shown): GUID Partition Map
- Now, click Erase.
- When done, quit Disk Utility to return to the utilities window.
- Select Reinstall macOS in the utilities window, then click Continue and follow the onscreen instructions.
After your Mac has reinstalled macOS, your Mac will restart to a setup assistant. In the setup assistant, you can choose to restore from a Time Machine backup, or if you want to manually restore later, skip that step.
Hope this helps! Let us know if you have any questions!
-Jack