MIDI is fairly straightforward to understand conceptually but it's often explained in a needlessly complex way. In a nutshell, there are only a few things to know. For guitar players, MIDI switching consists of three main components.
1. Channel - MIDI has 16 channels available. Generally, each device in your rig can be assigned one of 16 "MIDI channels" and it will only obey commands sent on that channel.
2. Program Change command (PC) - this is what you'll mostly use to change patches or amp channels on individual pieces of gear.
3. Continuous Control command (CC) - this is what you'll mostly use to continuously control things like expression pedals over midi. This is also used to control individual parameters of a patch while staying on that patch. For example in most loop switchers, PC commands change patches, while CC commands turn on or off individual loops within a patch, without changing patches. The CC command change is 0-127 and within each of those command numbers, there is an expression range of 0-127.
Example MIDI message when you press a button on your MIDI controller:
Let's say you have a MIDI compatible amp like a Mesa Mark VII (set to listen on MIDI channel 1), and a multi-effects unit (set to listen on MIDI chanel 2) in the amp's loop. You could setup MIDI switching to send a command to one or both devices at the same time.
MIDI Footswitch 1:
-MIDI message: Channel 1, PC 3
-MIDI message: Channel 2, PC 4
*This will change your Mark VII to its Patch 3 and the multi-effects unit to its Patch 4
MIDI Footswitch 2:
-MIDI channel 2, CC #7 (usually assigned to Output Volume) value 64 (remember the range is 0-127)
*This will change the output volume of the multi-effects unit to 50% (64 is the half way value between 0-127)