I smoke weed to help with anxiety and insomnia for over 6 years. I want to quit but not get addicted to sleeping pills. How does it affect fertility?

Probably not good. Unlike cigarette smoking, there is little scientific evidence about the effects on female fertility. In men it lowers testosterone and does reduce sperm quality. We don't know if a women smoking weed also affects sperm in her body. It may affect female hormones and ovulation. Our bodies make cannabis-like chemicals (endocannabinoids) and we are finding out what they do for fertility. Best to quit.
Possible decrease. Not well studied but some evidence suggests that both smoking tobacco and mj can decrease fertility, making it more difficult to concieve. Consider other rx for anxiety and insomnia, there are some with lower abuse/dependency potential. A councelor may be of great help as well.