First scrape up any hardened wax. Use a hard edge like a dull knife or a credit card but nothing too sharp or you will damage your carpet. This may take a good bit of time and you will only get up about three-fourths of the wax.
Next try placing a folded stack of paper towels or a cardboard blotter over the wax, then use a hair dryer or an iron to heat the wax so it will melt into the blotter. Be careful to watch the temperature to avoid burning or even overheating the carpet fibers. You may have to let it cool then reheat the was several times to get all of the wax out.