Position a brushless dc motor with encoder 12V

Start with this:

https://www.arduino.cc/en/tutorial/button

and use it to turn on a led. Then go thinking about driving the motor