Minecraft wiki entry for teleport, associated text: To rotate the nearest player 10 degrees to the right without changing their position:
execute @p ~ ~ ~ teleport @s ~ ~ ~ ~10 ~‌[Bedrock Edition only]
execute as @p at @s run teleport @s ~ ~ ~ ~10 ~‌[Java Edition only]