If we attach all the Servos to Arduino supply pins then do not work in a proper way due to the absence of sufficient current to drive all the motors.So we need to utilize a separate power supply for the motors, either it is from some adapters (5v 2A) or from 9v batteries.
Basically, a servo motor is an integration of DC motor, position control system, gears. Servo motors are accessible in various shapes and sizes. A servo motor will have generally 3 wires, one is for positive voltage second is for ground and the last one is for position setting.
For External Power supply we can utilize Adapters, RPS (Regulated Power Supply Instrument), or 9v batteries. Or else we can also utilize a laptop USB port to power the servo. For this, we just need to short the Arduino ground to external supply ground.
Utilize the Arduino code, which is given below to program your Arduino.