Brushless motor control poisition (design own PID?)
http://robotsforroboticists.com/pid-control/ seems to have a fairly simple PID pseudo code implementation. Also, it has some info into how to tune the gains.

In any type of control you gonna need to vary the input, in the case of DC motors is changing the supply voltage (or PWM). And you need feedback of the output, for motor is a tachometer or encoder, check the motor datasheet if one of the pins from the assembly would provide feedback on the rotation speed.

Transform that feedback into RPM and use that value as, in the PID example above, actual_value. Transform output so it can be used as your PWM bias.

I also suggest using unwinding for the integral error and output. Simply use if/else conditions to avoid those variables to exceed a threshold you defined.

To control the motor you can feed the PWM output into the gate of a N channel MOSFET, and connect negative terminal of the motor and ground throught the mosfet terminals.