'Format code' and 'sort using' on save in Visual Studio 2022

Why not try the Code Cleanup On Save extension by Mads Kristensen (who works for Microsoft). I have not used it myself but all his other VS extensions are awesome.

Edit: The 'clean on save' feature has been added to Visual Studio 17.1 which is in preview at the moment. So no extensions required.