As far as I know you can't. There is no abandon city button. In some previous games I seem to recall that you could build settlers earlier and remove the city that way since it cost pops. But that isn't an option since you need to many pops to do that.
I'm not even sure the AI will buy your core cities. As noted you can do it (raze) with cities you conquer, they can be razed at any time later (unless city-states or capital); holy cities can be removed if you remove the holy city status.
I guess you could do super badly in a war and hope the AI demands the city, or that they conquer it or conquer and raze it. You can't starve the city beyond size one either as far as I know, there might be some weird situation where you can out in the snow or something but I doubt it and it would be more of a fringe case. You could possibly starve the city down in size by just not working any tiles etc, sell all the buildings you can etc to make it an easier target for them.
You could probably flip-flop the city in a war since it will lose pops every time it its taken. So you let them take it, you take it back unless they burn it, hope they take it again and so forth until they either burn it or it's so small and useless that they will.
I guess if you really want to get rid of it you can delete, probably I have not tried it, using the In-game Editor or some similar mod.
yeah I already tried having it starve out (have the 1 citizen be a specialist). It just sits at 0/15 food at 1 pop when starving.
so getting a war enemy to raze it is the only way huh. That's hard since, though this is only based off one game, sometimes the AI avoids even attacking cities that it doesn't want, even if they are right next to it and undefended
The downside of the starvation tactic is that the city doesn't become very attractive to the AI either. So they probably don't want to capture that "turd" city. But they seem to do if they can so unless you go for the deletion route it's probably still the best bet. To bait them into to capture the cities you don't want. Which might be easier said then done since it sort of requires the city to be on the frontline as they won't do any deep-strikes into the land. That said I have found that they usually do take them eventually when they get around to it but the AI tactical mind is a bit wonky in that regard and it might take them a some time to commit to the idea and attack even if the goal is open. If nothing else they do it to increase the warscore in hopes of ending the war.
I wonder how difficult it would be to add a production item that when complete will destroy a city and generate a settler (or what ever best version of a settler you have)
If we wanted to go all in on this, we could add a civ trait to one of the more nomadic civs to get some sort of bonus when they do this. (Mongols could generate an extra settler per 3 pop in city plus the most advanced horse units unlocked?)
I wouldn't mind if there was some way of abandoning a city; spawn a settler etc and be able to move away. Certainly early on or perhaps more mid game when you find that some resource is or tile is just out of reach etc but there is not enough room for another city or whatever reason.