You are entirely reasonable to expect color-coding. I couldn't work without it, I'll say why at the end.
Use tape to code by function
But a switch circuit has a third wire function, called switched-hot. Use tape to mark wires to a different color. Which color should switched-hot be? Think about it:
Why do you use only black and white? Because you are using NM cable, and that's how it's sold. Neutral must be white, because Code requires this. Most places, black is always-hot, so you might as well stay with that.
Code now forces you to use /3 cable for switch loops, and the third wire is red. So it makes a world of sense to use red for switched-hot. So, voila.
That was easy. Black to black. White to white. Red to red. Done.
The other color-code I use is yellow for travelers in 3-way switches. (Both since there is no need to distinguish them from each other.) 3-ways are a nightmare if you don't do this, but if you do, it's easy. Two yellows in the same cable - guaranteed to be travelers.
I also use blue for "alt" switched-hot or for second set of 3-way travelers.
"Why? You can't figure out a simple switch loop, Harper?" Yes. Because it makes things really simple and easy to maintain. Here's an example of two switch loops, how hard can that be, right?
Here is the color coding. Circuit 1: H black, N white, Switched brown. Circuit 2: H red, N gray, Switched yellow. Circuit 3: H blue, N white-blue. LR=Lighting Receptacle (blue is unswitched). Switches up top, more switched outlets below. There are 7 wire-nuts in this box. Yet still, easy to maintain: as above, white to white, gray to gray, yellow to yellow.