Doctors use 2 types techniques for testing for steroids. The majority of testing is done using a urine sample. However, in some cases it is necessary to take a blood sample. They see the results using a machine called a chromatogram.
In sports, athletes are often tested or will be tested if officials are suspicious. If they are tested for steroids and the results are positive, they will be given a warning or be thrown out of the league.