can you switch between 2 main programs with an input signal(button)

Hi, i'm relatively new to arduino and i was wondering how you might go about writing a code for a project i'm working on.

I want to be able to switch between two main code with the flick of a switch or press of a button, one code relying on sensor in puts to do functions and the other code relying of direct input from an RC controller.
how might i do this in order to have a speedy response time? Also i would like to be able to quickly switch between the two codes, so would this require a reset function or something in between codes?

Any help is greatly appreciated!

p.s. I have no code written yet, so I can't show any thing yet (sorry).

Yes, and just to point in the right direction learn how to use FSM
heres a link to a good reference < Majenko Blog : FSM >

To keep code responsive, do not use delay() but do all timing based on millis(). You can have a look at the BlinkWithoutDelay example that comes with the IDE and read Demonstration code for several things at the same time

A few similar questions about switching between functionality were asked recently. Regarding that, I posted this reply yesterday in another thread. It might be useful (although in that reply I did not go into the details of using millis() for the timing).

thank you! Both these reply have been extremely helpful in pointing me in the right direction!