1. Install Upgrade Status[https://www.drupal.org/project/upgrade_status] module to check issues contrib and custom modules compatibility.
2. Remove Upgrade Status when all checks are green and ready to go. Uninstall Upgrade status and remove it from Composer.
composer remove drupal/upgrade_status
3. Temporarily add write access to protected files and directorieschmod 777 sites/default chmod 666 sites/default/*settings.php chmod 666 sites/default/*services.yml
4. Upgrade Drupal Core and modulescomposer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --no-update
5. If Drush is present, upgrade to 12composer require 'drush/drush:^12' --no-update
6. If core-dev is present, this might be requiredcomposer require 'drupal/core-dev:^10' --dev --no-update
7. Do a dry runcomposer update --dry-run
8. If no errors, upgradecomposer update
9. Verify again if no errors on update in step before with installcomposer install
10. Update Database and Export configdrush updatedb -y && drush cex -y
11 Restore read only acceschmod 755 sites/default chmod 644 sites/default/*settings.php chmod 644 sites/default/*services.yml
Links -- https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/how-to-upgrade-from-drupal-9-to-drupal-10