A check valve is used to prevent water from siphoning out of your aquarium. If water siphons out, it will usually damage the air pump and lead to water on your floor. In extreme cases, this can lead to fire if electronics are sitting in water.
If the air pump is positioned lower than the top of the aquarium, you absolutely need a check valve to prevent water leakage through the airline tubing. Cut the airline tubing somewhere between the sponge filter and the aquarium device, and attach the check valve in between so that the end of the check valve with the flapper (typically looks like a horizontal bar) is facing the air pump. If you install the check valve backwards, no air will flow when you turn on the air pump, so just flip the check valve around.
Best practice is to place the check valve near the top of your aquarium. This stops the water at the rim instead of down near the pump where over time the pressure could cause a leak. Make sure your airline tubing is cut nicely and free of any tears. Check to make sure the tubing hasn't dried out over time causing the connection to be loose as this will leak in the event of a power outage.
A Must-Have for Every Air Pump
A simple check valve is all that stands between you and a floor full of water. If your air pump is below the top of the tank, you absolutely must add a check valve between the air pump and the air-driven device (e.g., sponge filter or aquarium decor). If the air pump ever loses power or gets turned off, the check valve prevents water from traveling down the airline tubing due to gravity.
Don't Forget About the Brine Shrimp
A common "air-driven device" that people often forget about is their brine shrimp hatchery. We have personally lost power in the middle of the night and experienced the pain of cleaning up fishy, rotten brine shrimp all over our counters. So don't forget to add that check valve!