The top should look like a crown, or castle, at the bottom. Leave the castellated nut in place, just a few turns in to keep it in a safe place. If you’re working on a McPherson strut suspension remove the “pinch bolt” that clamps the ball joint stud. The goal is to try to guide it through the hole in the upper half of the steering knuckle. It can be somewhat difficult because of the extremely tight fit which helps hold the ball joint in place and the road grime built up around the suspension, so you will most likely need to use a hammer and a special tool called a “pickle fork” or tie rod separator to get enough leverage to maneuver.  With the wrench, remove the largest nut from the joint, replace with the new nut, and then drive the pickle fork between the control arm and the steering knuckle. You'll probably have to hammer it, and don't be afraid to get rough.This will probably ruin the gasket around the ball joint, so make sure you've got one to replace it. By putting the castellated nut on before hammering away, you'll avoid having the ball joint pop completely out and drop onto the floor, or more likely your foot. Loosen bolts or drill out rivets holding the ball joint in place, and slide out the ball joint. Sometimes, it's helpful to heat particularly corroded components with a torch to try to loosen them. Be careful if you try this. If your auto’s suspension uses pressed-in ball joints, you’ll need to remove the lower control arm and take the assembly to a mechanic with a hydraulic press, who can press the old ball joint out and the new ball joint in.

Summary:
Pull the cotter pin and loosen the large castellated nut. Pop loose the ball joint. Remove the allen bolts and slide the control arm free.