You didn’t say what programming language you were using, but in C++/Java you can use CameraServer to do this (Java below)
MjpegServer switchedCamera = CameraServer.addSwitchedCamera("switched");
UsbCamera camera1 = CameraServer.startAutomaticCapture(0);
UsbCamera camera2 = CameraServer.startAutomaticCapture(1);
...
if (button1) {
switchedCamera.setSource(camera1);
} else if (button2) {
switchedCamera.setSource(camera2);
}