The paper discusses two approaches to mathematically model an inverted pendulum and designs a PID controller for its stabilization, utilizing genetic algorithms for tuning the controller parameters. The system is demonstrated as unstable, and results show that employing genetic algorithms yields better performance compared to traditional methods in optimizing control parameters. Performance indices are calculated to assess controller effectiveness, indicating the suitability of genetic algorithms in solving complex optimization issues in control system design.