First of all, if it is a carpet next to the door, you can test the carpet's function of scraping sand and mud. Step on the carpet with shoes that have stepped on sand or dirt, and then walk on white paper. Check to see if there are any stains on the white paper. If so, it means that the carpet is not good enough to remove stains.
Secondly, if the carpet you choose is to be placed at the door of the bathroom and is mainly used to absorb water, you can wet your hands and press on the carpet to see if there are water stains on your hands. If there are water stains, it means the carpet is absorbent general.