Arduino Momentary Switch Question

I am using an arduino mega with a couple joysticks from adafruit. The joysticks are controlling my servos but there is a select button on the joysticks. I want to use the joystick's button to turn on and off an mosfet which will drive my vacuum pump. Is there a way for when you press the button it will turn on the pump then you need to press the button again for the pump to turn off?

Yes
You have a state variable that you toggle in your code
each time you press the button.
Make sure to debounce the button.
You will obviously need to buffer the control to the vacuum
pump some how.
A solid state relay might be what you want.
Dwight

im using a 12v vacuum pump.

It still need something between the arduino and the motor.
A power FET with logic level input can be used.
The motor will surely need more than 20ma and you can not
connect something with more than 5v on it to an output
without damaging the uP.
Dwight