Marijuana can stay in your system for 30 to 90 days or more. The first step you will have to take to pass a drug test is to stop using any weed in any form. If you have a hair test, you will have a much harder time passing a drug test. Marijuana can stay in your hair for up to a year. Although there are products for hair, they are not as effective. If you need to pass a drug urine test, you have more options depending on how much time you have.
If you find yourself in a situation that requires you to pass a drug urine test in the next 24 hours, your options are limited. The only real solution is using a temporary flush or cleanser. This works to remove toxins from your urinary tract to give you a small window of about 6 hours of drug free pee. After the 6 hour window, the toxins will start to re-enter your urine.
Here are a few of the products available, but shop around and check reviews: https://www.passyourtest.com/same-day-cleanse-products/
Ok, if you have at least 30 days or more you can use the natural method of cleansing your body of THC.
If you are unlucky and fail your drug test, don't give up. Fight for a retest. It is well know that drug tests often have false positives due to a variety of reasons, including poor quality control.
NORML offers a hotline that gives free advice to all paid members on how to pass a drug test. Their number is 1-888-67-NORML.