How would I implement it?

look up AURA’s Skyrise engineering notebook, they have a great example of gyro PID

The error in this case is the degrees away from target. Then it is normal PID. The values for Kp are generally much smaller in rotational PID.

You do have to do some corrections to the angles for positive and negative values. For instance if you want to get to 190 degrees that can be -170 or +190. So normalize the angle for the reading it from the gyro. The gyro value and the target need to be similarly ranged values to compare properly against each other.

Small changes in destination angle can be problematic for some PID’s if the I is pretty small. It is hard to get moving and then momentum takes over. So tune away!