How are athletes tested for drugs?

Athletes are banned from taking any substances that can give them an unfair advantage in competitions.

The World Anti-Doping Agency makes a list of banned substances every year.

How do officials test athletes to make sure that they haven't used them?