How do you pass a narcotic drug test?

There are a lot of factors which can affect passing a drug test. First what kind of drug test you are going to take, are you a heavy user, what drug you use, what is your body type etc...