How to create a basic day and night cycle in Unreal Engine 5?

Personally I’d suggest using the built in sun position tool.

You can follow that guide but just change the widget part to a looping timeline updating the hours from 0 to 24.