Rotating the official touchscreen display (both the display and the touch input) is now easier than ever and can be configured via the Raspberry Pi OS desktop menus.
Update first (Important!)
First, update your Raspberry Pi OS as you'll need to be updated from at least 11/10/2022 as it was around this date that the changes were implemented into Raspberry Pi OS
You can update your OS in a terminal window, entering sudo apt-get update followed by sudo apt full-upgrade, then reboot.
Rotating the Raspberry Pi Touchscreen Display
Simply select the Raspberry logo, then select Preferences then Screen Configuration.
A new window will appear. Select Layout > Screens > DSI-1 > Orientation and then select your desired rotate. To turn the screen upside down, select the invert option.
After reboot, your display and touch should be rotated!