CiviCRM is released for Joomla 4 and 5 – there is no official Joomla 6 build yet, so don't upgrade Joomla first on the live site.
A safe order:
1. Update CiviCRM to the latest release while you are still on Joomla 5, and check the System Status page is clean.
2. Copy the site to staging and upgrade Joomla there.
3. Test what CiviCRM does for you – contribution pages, membership renewals, mailings, the cron – before touching live.
CiviCRM can run on Joomla 6, but only with compatibility work around the Joomla 5 integration. If you want, describe which CiviCRM parts you use and we tell you how much of that applies to your site.