There are
two switches in the brake warning circuit. If the contacts in either switch are closed, it will create a path to ground and illuminate the BRAKE light on the dash.
One of them, like Boone says, is operated by the parking brake lever and closes when the pedal is pressed down (or is hanging down). That is more of a reminder that you need to release the parking brake. If not, you'll wear out your brake pads/shoes and the truck will go really slow.
Now the more serious cause of the BRAKE light coming on:
There are 2 brake lines that exit the master cylinder. Before they lead off to any of the actual brakes they go to the "brake proportioning/combination valve". It is there that the 2 main brake lines from the master cylinder are split into 4 lines. Those four lines then go to the individual wheel cylinders.
You must be registered for see images attach
There is an electrical switch built into the proportioning valve. The switch is operated by a spool that is normally centered within the valve. If there is a loss of hydraulic pressure on one side of the valve when the brakes are applied the spool shuttles (either the left or right depending on which braking circuit loses pressure), closes the switch and the warning light on the dash illuminates.
From what you describe (having to pump your brakes to get pedal resistance, your brake warning light is lit and it requires more effort to stop the truck) there is most likely a serious problem in your hydraulic system.
First thing is to pull the cover off the master cylinder and check the brake fluid levels in the two reservoirs. You will probably find one is either very low or empty. You can try to refill it and maybe the brakes will self bleed. It may take a lot of pumping, but these brake system are very forgiving about entrained air. Very often, if the air is near the front only, the air bubbles will just rise to the master and vent out.
But - no matter what - if you find low levels in the master, you will have to find out where the brake fluid went. You should immediately inspect your brake lines for leakage.