attiny85 to control two different jobs through a switch?

What i really want is to piece up 2 sketches together in attiny85 programming,the result is to enable it to be controlled through a switch.the 2 sketched are pretty long.I don’t know how bcz i am a newbie in programming.at first i thought of 'Case,break’syntax,but later found it may not suitable.

The pins i choose is Pin4(Analog2) physical pin3 of attiny85 to control of WS2812B light strip.another Pin1(PWM)physical Pin6 to control a speaker.

#include <Adafruit_NeoPixel.h>
#include <avr/power.h>

#define PIN 4

Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  
  Serial.begin(9600);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}


void loop() {
  
  int sensorValue = analogRead(A0);
 
  Serial.println(sensorValue);//Just for the calipration
  
 

  if(sensorValue > 10)
  {
rainbowCycle(0); 
}
if(sensorValue >30){

theaterChase(strip.Color(255,0,0),10);
theaterChase(strip.Color(255,0,0),10); 
theaterChase(strip.Color(0,0,255),10); 
}
if(sensorValue >40){
  colorWipe(strip.Color(255,0,0),10); 
  colorWipe(strip.Color(0,255,0),10); 
  colorWipe(strip.Color(0,0,255),10); 
}
}

//this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*1; j++) { // 1 cycle of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}
//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
  for (int j=0; j<5; j++) {  //do 5 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();
     
      delay(wait);
     
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else if(WheelPos < 170) {
    WheelPos -= 85;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  }
}

========================

Speaker sketch

/* ATtiny85 Speaker */


// constants 
const int Speaker = 1;             // speaker pin

void setup()
{
  pinMode(Speaker, OUTPUT);


void playBeep(void)
{
    for (int i=0; i < 500; i++)
    {
      digitalWrite(Speaker, HIGH);
      delay(1);
      digitalWrite(Speaker, LOW);
      delay(1);
    }
}

You have two programs that each do something. If you have requirements for the new program, you’ve forgotten to disclose them. Without requirements, you can’t write code.