I remember getting horrible headaches right around this point in my programming journey and just giving up for decades until I discovered Visual State Machines. Might even give those up if ChatGPT generates code for me!