Depending on the type of carpet, the easiest way to do that is to vacuum it, then tuft the carpet by hand. If that doesn't work, place a damp towel over the carpet, then run an iron over it to gently steam it. Then, fluffy the carpet by hand or gently comb or brush it.