Upgrading Operating System only. OS 2016 - 2019
I suggest you read up on Database Compatibility at https://aka.ms/dbcompat
What this will tell you is that validation is not done at the SQL Server major version level but at the database level.  This should ease your concerns about upgrading from SQL Server 2017 to 2019.
However, if you are staying on the same version for cost purposes (e.g. you don't have software assurance to get free upgrades) then running SQL Server 2017 on Windows 2019 is fully supported and does not change the features or functionality of SQL Server.  See the support matrix for confirmation of that