At all sporting events and in every league, there is random drug testing. This is usually a urine sample, but this does not detect all drugs very effectively, so some people are trying to get blood testing for illegal drugs.
If a drug is found in someone's body, it doesn't mean they will be punished. Some drugs, like Nandrolone, are made naturally in the body, but in very small amounts.
This makes it very hard to tell if the sportsperson has been cheating. If they have, then they are usually banned.