Strongly recommend reading section 6.3.5 of the manual before you used this guide.
How Do I Get Them?
I'll ignore the special case of Sparta here (see section 6.3.5 final paragraph).
They come from war - won battles (if large enough), sieges and raids. So if you are getting too many you may want to be less aggressive (realise there are other dynamics at play here).
Where Do They Go?
There are two rules at work here.
If you have no slave market, they go to your capital. You rarely want too many here so...
If you have a slave market within 10 regions of the event (battle etc), they will go there. Now there are a couple of quirky bits here. AFAIK they do not cross the sea, so a slave market on an island will rarely get slaves (except off naval battles).
Ok, time to leave morals out of this.
You need these, in part to ensure that the slaves don't all go to your capital and then revolt.
They help spread the load as you win battles, and also the more you have, the more control you get over the slave population.
In general work on a ratio of 1/12 regions and if you can put them in regions where you plan to build culture/loyalty buildings
To repeat, the more slave markets you have, the more often you can intervene to minimise the problem.
Unofficial tip - you can disband existing ones (causes a small short term loss of loyalty) and rebuild elsewhere ... this is one to get them to spread around especially if you have civ level 1 government.
Putting Them to Work
The easy bit, in the main use them for agriculture or infrastructure, but they can do commerce/culture in an emergency.
They also, generate building slots personal view, in early playing of the game, people over-emphasise how important this is. FWIW, I'd rather have a loyal region with some missing buildings than one hooching with unrest for none Scottish readers, I'll leave you to guess what hooching means.
Here's where they hurt. The table in 6.4.3 is your friend here.
Every slave adds their nationality + 50% to the unrest value of the region. If this gets high enough, the region becomes first very inefficient and then you have a revolt risk.
So those German slaves you took when you invaded that region on the other side of the Rhine? 9 unrest points each.
Again AFAIK, slaves don't flip to your ethnic group while they are still slaves so you are stuck with this.
There are three ways to move them.
First, there is the freedman decision (rare if you are civ level 1 govt), this converts slaves to citizens (initially with their old ethnicity). Its good as you keep the building slot but generates a block of unrest in regions with the slave markets. You don't need a slave market for this decision to come up.
So if you have a lot of slave markets - be careful with this one.
The second way only occurs if you play on easy or balanced, there is chance that one slave will be moved each turn. They will not be removed from a region where pop is less than 2 above the building slots in use so its not that great but helps,
The third is a decision that can only come up if you have 1 slave market (and its frequency is determined by how many you have).
This will shift a lot (up to 10) from regions with slaves to those without. The transfer takes no account of where the slave markets are. The only constraint is this will not reduce your pop below that needed for your current level of buildings.
Getting Rid of Them
This might seem unintuitive. After all you won a war and these are the spoils of tha war. And they give building slots and you want as many as you can?
Well yes and no. There is no point having lots of slots in a region with low loyalty as loyalty is part of the formula for converting potential output to actual output (as an aside this is why loyalty > 100 is good).
For myself, I take this option almost every time. The money is nice, I've funded emergency armies of mercenaries from it, and it really sorts out low loyalty.
Yes my regions grow more slowly but they stay loyal.
Civ Level 1 Govts
These have real problems and are hard to solve - mainly as the free/move/sell decisions come up more rarely.
Equally, many such factions need to raid for the income (at least when I play them).
So What to Do?
The only real solution is to be careful about early expansion and build a lot of slave markets. That'll mean the sell etc decision comes up more often, at worst it'll help spread them around.
You can always disband some of these when you advance.
But I've lost my capital in a few games to slave revolts with tribal starts.
Well I just founded another, at some stage retook my original and sold them all for profit and new armies.