What should I do if I don’t want to have sex with someone anymore but still want them as a friend?
Consent doesn’t just apply to sex. It applies to everything. Including friendship.
If you decide not to be sexual with someone who still wants to have sex with you, you can’t command “friendship” out of them as a way of circumventing their disappointment and frustration. They might need a significant amount of time away from you to deal with the situation before even considering friendship. They may even reject you completely and never have anything to do with you again. Or they may accept your friendship offer, just like they previously accepted your offers of sex.
But it’s always their choice. It’s not something you can make happen because you’re wary of the consequences of dumping them.
Here’s what you can say as an honest and ethical individual.
“I’ve really enjoyed being intimate with you, but I no longer want to do this anymore. I hope we can remain friends.”
The rest is up to them. Good luck.