I have been on four Carnival cruises to the Caribbean, so I have a little experience. Different lines or destinations may be different as far as what to wear on a cruise.
Most of the time, I wore shorts, sandals, and a tee shirt.
For the regular dinners, I wore dockers, a short sleeve polo shirt, and some casual shoes.
For the couple of formal dinners I wore a suit, shirt, tie, and dress shoes.
When going ashore I usually more the shorts, tee-shirt, and sandals. I might wear swimming trunks under the shorts depending on what we were going to be doing. Once in a while, I wore a pair of jeans if were going to be hiking in the jungle, or doing something like a canopy tour with zip-lining.
If you are going on an Alaskan cruise, you might want to dress warmer. I have not been on an Alaskan cruise yet.
But most of the time the answer to what to wear on a cruise for me is shorts, tee-shirt and sandals.

For women, what to wear on a cruise would be different, involving dresses and stuff like that, but I am a guy, so I don’t know.