Digging up a grave is called "disinterment" and is done only in the most necessary circumstances, like a murder investigation or physical cemetery move. Considering doing it yourself is both impractical and illegal, not to mention just a bit on the ghoulish and frightening side. As to the actual digging of the dirt, the cemetery has equipment for just such a procedure.
Get permission to dig up the grave. Reasons can be that a grave needs to be moved to bring a relative closer to another in another cemetery. Sometimes a cemetery moves entirely and digs up all graves; sometimes a murder or other criminal investigation will necessitate the disinterment of a body. No matter what the reason, multiple permission from country, state and counties (depending on where you live) are required. For the most part in the United States, you get a permit or letter of permission from The County Health Department, or your local religious organization if the body is buried in a religious cemetery. If it's a criminal investigation, the district attorney will handle everything. If the cemetery is moving, it will provide forms for you to sign.
Fill out and submit the paperwork required. Make sure to have a lawyer look over the papers, particularly if there is a criminal investigation going on. You need to protect yourself so that you are on record as following all required paperwork and laws.
Leave the work to the cemetery. Once they have the paperwork, they will use heavy-equipment earth movers (backhoe) to dig up the grave. The coffin will be removed and the body will be taken to the coroner's office in the case of an investigation, or the coffin will be transported to the awaiting cemetery.
Make you own arrangements for seeing the body if you feel you need to. Speak with the coroner or the funeral director and, again, sign the necessary paperwork, if any is required. Mostly, again in the United States, the Department of Health will have forms to sign and the funeral home will usually have copies to fill out. If you are not related to the deceased or part of an investigation, you have no rights to see the exhumed body.