Signals can get complex VERY quickly. Maybe I can explain in steps.
First, lets assume a single track railroad, and three-color signals (the simplest). You’re approaching the end of a ‘block’ where a signal will be. The signal head (this will be a single head) could display one of three ‘aspects’, Clear (green) Approach (yellow) or Stop (red). Clear means you have at least two blocks of ‘clear’ track ahead. Approach means that you have one block of ‘clear’ head, and, well, stop means stop. That’s the basic rule. Now lets throw in a passing siding.
Now is where it gets fun. You’re approaching a passing siding. The signal will have TWO heads on it. The top head governs what you can do with the Normal (straight) piece of track ahead, and the lower head governs what you can do with the Diverging piece of track. Lets say you are OK’d to head onto the siding. The TOP head will be Stop (red) because you can’t go on the main, and the lower head will be either Approach (yellow) or Clear (green) depending on various things like track speed, etc). Lets say its Approach, because your supposed to stop on the siding. Instead of saying all that, we call that Medium Clear (see chart)
That’s about as simple as you can get with simple signals. You can get into all sorts of configurations with three heads (interlockings, etc) and a bunch of other rules.
Signals are fascinating, one of the things I love about RRing.