How can I wean from breastfeeding?

I’m starting to potty train my 18 month old that is still nursing. How do I give her the comfort of nursing and wean her from that. She often will sit on me when I am busy doing some thing for comfort I feel so bad for her how do I set safe boundaries For my baby that’s not a toddler.