Dig a hole with a post hole digger alongside the post that needs to be replaced. Dig the hole down to the bottom of the existing post.
Move the post back and forth to loosen it from the ground a bit. Pull it toward the hole that you just dug.
Pull the rails out of the existing post. Set the rails on the ground.
Set the new post into the hole where the previous post sat. Slide the rails back into the slots on the post.
Fill dirt back in the hole around the new post. Tamp the dirt around the top of the post.
Replace damaged rails. Slide new ones into the slots on the post. Fill the dirt back in the hole around the new post.