Digging is normal behavior for rabbits. House rabbits come from a heritage of underground burrow/warren living wild cousins. But your pets instinctive behaviors should not be causing damage to the home you share with them.
Stomping and/or clapping your hands while saying "No" sternly, is the best method for stopping any bunny behavior including digging while it is actively occurring. For long the long term solution you need two things; One protect from the occasional occurrence, Two redirect the instinctive behavior into an acceptable direction.
Digging on the carpet is almost exclusive limited to an accessible corner. In my experience there are 1 or 2 corners that the bunny will be extremely drawn to dig at. A ceramic floor tile placed in the corner will protect the carpet, and significantly disrupt the digging.
Tiles can be purchased at your local home improvement store very inexpensively. Size from 4 to 12 inches can be effective. The larger tile, also provides a cool place for the bunny to lay on hot days.
The tile disrupts the behavior in two ways. First it protect the carpet, if the claws don't touch the carpet, they carpet does not get harmed. Second it protects the carpet, if the carpet is not modified by the digging, than the digging is ineffective and the rabbit stops digging there.
So now you protected her favorite digging corner, and you don't want her to find another corner to dig in, or to decide she needs to dig out her litter box. It is time for the redirection.
Build your bunny a digging box!
Your rabbit needs to dig, in the same way some dogs need to fetch, or a cat has to claw the bed before laying down. So give her a place to dig that will not harm anything and provide opportunities for exercising muscles and instincts. There are multiple examples on the internet. The following example stems from a solution I found years ago and has been modified by my experience and requirements.
Cardboard boxes can be used, but they don't live very long and the carpet under the box can be damaged from activities.
A plastic storage container with a hole cut in one end and filled with litter and hay makes a perfect, long lived, happy place for your bunny to dig. It can be carried out to the compost pile to be emptied, cleaned and refilled. With two 6 pound girl bunnies using it we empty and restock it every other day. Adding fresh hay as needed through out.
The girls eat and dig in the hay, they also use it as a litter box. We purchase timothy hay in bales (horse/cow size) at the feed store, so conserving hay is not an issue. If you are purchasing hay at the pet store, you may want to use a different filler (i.e. paper or cardboard with out glossy print).
Now this seems like a great solution, but it does have a drawback, sometimes one of the girls decides she needs to do some housekeeping (even if I just changed it) and she will try and dig all litter and hay out of the digging box through the door. As you can see in the image, this model has a tray on the floor in front of the door. When it gets dug out I can pick the tray up and dump it back in the digging box.
The door in the front was primarily designed to allow an older disabled bunny to get in and out, he is no longer living with the girls (he is the bachelor room now). So we created a new version, without a door. No top and a board is used as a landing place so they can jump up and down without having to clear the sides in one leap.