Weaning help

How can I stop breastfeeding without getting clogged ducts or mastitis? I posted a few days ago about my son biting me and I’ve tried everything and nothing is helping and it’s been extremely hard on my mental health so it’s time to stop 😕 I would like to wean him but I’m scared every time I feed him because he does it randomly and will only eat when he’s half asleep. He only falls asleep while nursing so that’s definitely gonna be difficult but I can’t do it anymore that shit hurts 😩😩 any advice on how I can stop without weaning?