Server upgrades are covered here. Server 2019 to Server 2022 is a supported, inplace upgrade. You are allowed to move from a "smaller" edition to a "larger" edition in most cases, as discussed in the documentation. You cannot go the other way. You also cannot upgrade from a licensed to an unlicensed version. None of that applies to you though.
For your case, assuming your server hardware is supported, you can do an inplace upgrade from Server 2019 to 2022. Read the documentation to ensure that you aren't running anything that will have issues with the upgrade though.