First of all, you need to upgrade your composer version, PHP version, Mysql version, Elasticsearch, and others you are using in your Magento website.
To find compatibility Click here
After upgrading versions:
You need to take backups of the database, app, lib, setup, composer.json, composer.lock, and vendor.
Now next step is to upgrade Magento version from 2.3.x to 2.4.5 (which is the latest for now).
Also, you need to change the catalog search Engine to Elasticsearch as Mysql is deprecated in Magento 2.4.3 and above versions.
Using below command:
php bin/magento config:set catalog/search/engine elasticsearch7
Run below commands:
composer require magento/product-community-edition 2.4.5 --no-update
composer update
Then run basic commands like, setup:upgrade, setup:di:compile, s:s:d, c:f
Magento will give you errors for custom modules, custom themes, and also for the modules you override.
You need to make it compatible with PHP 8.1
and issues related to HTML files.
After running all the commands successfully. Test all the Magento websites thoroughly.