Colourful sticky traps (typically yellow) attract flying bugs. Pests cannot escape the paper's sticky glue once they land. Adult reproduction is also stopped, restricting spread. To catch bugs, replace them every few weeks because pest covering and dust weaken the stickiness.
The most common type of houseplant traps have sticks that are sunk into the ground so that the sticky part stays just above the ground. Fungus gnats are drawn to wet soil, so these are great for getting them. Anging traps should be hung at the level of the pest problem to get the most bugs.