Integrating gyro stabilization into arduino RC- receiver

Start sensibly by reading about PID, and finding some elementary PID tutorials. Work through a couple of examples.

Once you understand how it works, you can start thinking about incorporating it into your existing code.