Need guidance on programming technique

If you want a simpler and trouble-free approach then get a full grasp of BlinkWithoutDelay and then State Machines.