Best way to remove upper ball joint

it the suspension is still together then i would leave the upper control arm bolted up and break it loose with the socket then take it all out. i have bent an upper control arm trying to take the ball joint out while it was out of the car.