Call the Professionals
Unless you are prepared to undertake a major project to expose your well, you want to consult with a professional company that specializes in cleaning wells first. Most wells are going to be deep, and attempting to clear out a large amount of debris on your own will be risky. You also must consider that it may not be dirt clogging your well. Another problem could be causing the backup, such as a build-up of calcium or other minerals on your filter that have gradually reduced the water flow through it. Many companies offer free consultations, and with a professional doing the work, you can relax.
Vinegar is a potent home remedy used to clean solid buildup. Open your well and drop 1 to 2 gallons of white vinegar into the system and allow it sit for 10 to 12 hours. Leave the well open during this time. In the morning, close the well and use an air compressor to force the water and vinegar through the filter. Prime the pump and flush the system, and see if it has been cleared. If you still experience problems, repeat this step.
There are several products available for cleaning wells, some as benign as chlorine and others so strong they're considered industrial-strength chemicals. Before attempting to use a chemical cleaner for your well, consult with a professional. Using certain chemicals can contaminate your water, damage your well, and even eat through your filter. One example of a chemical you can use to clear your well is Bentonite remover, which can break up solid clay and dirt chunks within your well.
To manually remove dirt or buildup clogging your filter, scrub the walls of the well. Buy a wire brush from a hardware store, and extend the handle by screwing plastic pipe to it. Make sure the pipe is sturdy enough that the wire brush won't come loose and fall into the well. Once it's long enough to reach the bottom of the well, use it to thoroughly scrub the well walls and the filter. You can choose to chlorinate your water, using between 1 and 2 gallons of bleach, after you've scrubbed the walls. Allow the bleach to sit overnight, then use a garden hose to rinse out the well casing for about 30 minutes. Flush out the bleach by pumping the water out of the well until you no longer smell bleach. Make sure to pump the water out away from your garden. Use a pool testing kit to make sure your water is clear enough to use again.