Smoking weed and being on the pill

Don’t know if this is a stupid question but if I smoke week will it affect my pill ? ( I only do it when i get really bad anxiety )