I know of two types, there may be more. One contains a plastic ball. They make them for both hot and cold ports on the WH, and you must get them in the right place or you'll block flow when you open a faucet.
The other type has a flap that springs back to prevent flow. Sometimes they are supplied with the WH and may incorporate a dielectric union. They often look like a galvanized nipple and may have an H or C or arrows on them to indicate the direction of flow.