Is there a way to rest at an intersection without (partially) dismounting the bike? I have seen this done, and it probably has a name or another way of describing it that I have not thought of, but I cannot find information about it on the internet.

When stopped at an intersection, some cyclists will turn their front wheel to the side, and it seems to help them stay on the bike while the bike is not moving forward. Unless I'm imagining things.

I'd like to know how to do this, how it works, etc.
It called a track stand. It originates in track racing on a velodrome, where in the opening stages of the individual sprint event you sometimes need to come to an almost complete halt. Tricky and dangerous to do if not well practiced, it can end in a 'sprawl of shame' if your technique is not perfect.