HELP! How did you stop breastfeeding your toddler?

I would like to stop breastfeeding my 2 1/2 year old toddler. He currently breastfeeds every 30 mins and wakes up in the middle of the night and will stay sucking for an hour at least. He will try to take out my breast in public and when I say no he will throw a fit. He has speech delay and isn’t talking yet so I can’t explain to him that I’m tired or my boobs hurt. I need tips on how to stop