How can I update my macOS 10.14.6 to latest version? I am using a 2019 MacBook Pro and I haven't updated the macOS in a while.
Now when I want to update it to the latest version (macOS Catalina).
Every time I try it in System Preferences, I get an error (connection lost or time out).
And I also can't download it from Apple website, because macOS Catalina requires macOS 10.15, and my macOS version is 10.14.
This error occurs on another mac too. What should I do?
macOS 10.15 is macOS Catalina. The former is the major version number for macOS, while the latter is the marketing name. Both are essentially the same operating system.
So, you do not need macOS 10.15 to install macOS Catalina. You can go to Mac App Store and search for macOS Catalina, or use the following link to access the macOS Catalina page on the Mac App Store:
https://apps.apple.com/app/macos-catalina/id1466841314
Once you have the page open, click on the GET or the  button to download the macOS Catalina installer.
Once downloaded, the installer would launch automatically and guide you through the installation of macOS Catalina 10.15.
Using the Mac App Store would also let you automatically get the current latest update of macOS Catalina, which is macOS Catalina 10.15.6 (6th point release of macOS Catalina).
Should you encounter any issue with installation, make sure you are logged in with an account with administrative access.
Also, make sure you have a backup of your critical data for a very less likely case where the installation may fail.