If you are trying to replace a submersible well pump first read my article about removing submersible well pump, it's in the the resource section of this article. I broke it up into two articles because it's a lot of information.
Once you have the old pump out and have determined it needs replacing you can see the type and model pump that you need to buy. Wire the old pump directly to power source once you have it out to make sure it needs replacing and that the problem is not in the wire that ran down in to the well.
If you determine that the water level is still the same as before ( I'm going to write an article on how to determine this in the future) measure the wire or safety rope that you used to pull the pump out to determine the length of the new pipe if it needs replacing, more than likely this is the case as the PVC pipe used on most installations is hard not to break on removal but the polyethylene pipe for the new pump installation is not expensive. When measuring for length of replacement pipe do this before you buy the pipe so you can by a roll big enough for the entire length, you can't come up short here and you can't splice sections together.
Take the polyethylene pipe and unroll it on a sunny day. The sun will relax the kinks and allow the pipe to soften slightly allowing much easier handling. Tape the wiring that was attached to the original pump, assuming it doesn't need replacing (it normally wouldn't but a well company would try to sell you new wire) to the polyethylene pipe at eight to ten foot intervals for its entire length ( typically 150-250 feet for a well)
Make sure you have the circuit breaker off to the wire that leads to the well, test it to be sure. Take the waterproof electrical splice kit that is appropriate for your gauge wire and splice the wire leads from the end of the wire that is now taped to your polyethylene pipe to the leads on the new well pump. Before you put the pump back down the well test it by turning the circuit breaker on and temporarily connecting the well wire to the wire that comes from your house. I put the pump in a barrel full of water so I could test it and not damage it, you should see a jet of water shooting out from the barrel if it's working properly.
Attach the pump to the polyethylene pipe with whatever brass fitting is appropriate and replace the check valve , as well, which is above the pump, unless it is a pump that has one built in. It's probably a safe bet to duplicate the set up that was used on the original well pump.
To lower well pump you have to use the pulley and tripod assembly discussed in well pump removal article, but first you need to tie the safety rope attached to old pump to new pump ( unless damaged than replace) and thread it through pulley and attach other end to truck or other vehicle to anchor it. Back the vehicle up as you lower well pump/hose/wire assembly down the well hole.
As you near the depth required, you have to attach the pitless adapter to the end of the polyethylene pipe by hose clamps or whatever means are appropriate. Line up the pitless adapter, as you lower it carefully, with the the slot it slides into on the inside of well casing until seated fully. Using a rubber mallet to tap the pitless adapter into its slot can make it easier to assemble.
Now take the other waterproof splice kit and splice the power wire from your house to the wire that is connected to the pump. Test everything now before you close well cap and that should do it- it's a lot of work but it can save you thousands of dollars and if you're a very handy confident DIY'er it can be done.