yellow LED not turning off in traffic light simulation
Your program runs in a tight loop - an extremely tight one which does all but nothing in any state but 1 or 2.  However what happens in these states is interesting.

Essentially what you have is


Quickly check for input - which won't be detected unless the bottom is being held down at this precise narrow slice of time between long delays
Turn on an LED, apparently from your comment the yellow one
Change the LEDs but recycle so quickly that this fact is generally invisible.


The result of this is that instead of a brief pulse of yellow, you will be seeing near constant yellow, because that is the only part of your loop which takes any time.

Probably what you want to do is to advance the state when you are done with your brief yellow flash.  But it's not possible to say what you should advance the state to, since it's unclear how you want this light to work.  If it is purely timer-based, then you don't need any input at all; while if the button is supposed to do something but a timer should also be used, then you have a more complicated problem.

Essentially, before you can write any code you must write in words or diagrams a comprehensive set of "rules" for what the system is supposed to do.