You simply configure a servo in firmware. You can have up to 4. Then control it with M340 where needed. The pin you configure is the signal pin of your servo. Make sure to have extra power supply for it. Taking 5V from board is normally a very bad idea as servos draw too much current.
<p class="p1">- M340 P<servoId> S<pulseInUS> R<autoOffIn ms>: servoID = 0..3, Servos are controlled by a pulse with normally between 500 and 2500 with 1500ms in center position. 0 turns servo off. R allows automatic disabling after a while.</p>