Setting a compressor is an art and for a long time even the “pros” needed time to be able to do this.
Think about it… it’s just difficult to hear what the compressor is actually doing, right? So how are you supposed to be able to adjust it to get the right settings?
The long answer: many frustrating years of practice.
And that’s not even a guarantee because there is no “one size fits all” attack or release, so you still need to experiment and figure out what the compressor is doing.