The quadrotor is a VTOL-capable unmanned aerial vehicle with excellent agility, four propellers, and six degrees of freedom. Because of their simple structure and low cost, they have attracted a lot of interest in recent years. Despite its apparent simplicity, its nonlinearities and linked dynamics make control difficult.Because of its simple nature, PD control is extensively utilized in quadrotors. A PD controller for quadrotor altitude and position stabilization is proposed in this paper, with its parameters calculated using the Firefly Algorithm and Genetic Algorithm. An objective function is developed to offer not only precise positioning of the target position, but also to enhance the motion's settling time. A test path from the rest position to the target position is examined for performance verification of the suggested method. The obtained findings show that position stabilization may be accomplished in a short amount of time, and the settling time is significantly reduced when compared to specified settings by Genetic Algorithm. The PD controller settings determined via the Firefly Algorithm optimization method surpass the ones chosen by Genetic Algorithm with a substantial margin.