Well, first of all, you will need to have access to a certain kind of vacuum to suck up all possible dust. Make sure it is as powerful a vacuum (suction-wise) as your carpet can handle, since you will need to remove as much dust as possible from the carpet before you can wash it. You can get a special drywall filter for some vacuums, so make sure you can get a hold of a vacuum that you can get such a filter for, so your vacuum will not get clogged up from sucking up drywall dust without one (thus causing you to end up kicking dust back into the air you are breathing).
You can rent a vacuum from a home improvement or other kind of industrial store, and I recommend this, since fine drywall dust can get into the motor of the average vacuum and wear it out. Also, see if you can get a vacuum that uses a HEPA filter. Use a freestanding air filter, too, preferably that uses another HEPA filter, and preferably one that can be cleaned and reused, since it is always nice to be able to clean your filter whenever you feel it needs it, and very convenient to hose off your filter outside the house (away from any drains that can be clogged).
Be sure to turn off the heating or air conditioning in your home before you begin your attempt to clean the drywall dust off your carpet. It just blows dust around. Just in case there is a lot of dust in the air, I suggest you wear a face mask because what a vacuum cannot even filter out, you probably will not want clogging up your respiratory system.
Now, once you have vacuumed as much as possible off your carpet, use a carpet cleaning machine. The carpet cleaning industry is really loving the steam cleaner and I have to say that I think it is a good method for removing excess filth from your carpet. Use the steam cleaner on your carpet, being sure to pull it backward slowly as you would your vacuum cleaner so it can have time to get plenty of the resultant fine mud out. Also be sure to use some good carpet cleaning solution in the machine, so it can be injected deep in your carpet and will pull up as much stuff as possible. Only do the wet cleaning when you have removed as much dust as possible from your carpet. Again, get an appliance that will create as much suction as your carpet can handle so it doesn't leave stuff behind.