I am in a slime chunk and it is pitch black down there and I made a farm with cacti and an iron golem. I don't really care if it even works. I just want slimes to spawn. My farm is on y level 55 in a swamp biome and I stand 24 blocks away from my farm when I afk it. The ravine nearby is lit up like a kid's face on Christmas. Mobs are spawning in my farm (but no slimes). I think these mobs are preventing the slimes from spawning but I do not know how to get rid of the mobs so that slimes can spawn but mobs do not.
Firstly, use a slime chunk finder to make sure you're in the right area. You can enter your seed into the tool, and it will locate the chunks on your world that are slime chunks.
Secondly, light levels do not affect slime spawning in these designated slime chunks. They will still spawn at light levels above light level 7, when other mobs do not.
And finally, you will need to light up the surrounding areas underground, to increase the spawn rates of your farm.
Edit: An important fact that I failed to add (thanks to SF for pointing it out), Slime chunks will only spawn Slimes at levels below Y:40 (unless you're in a swamp biome). This means to gain any real productivity from this farm, you will need to dig all the way down to bedrock, and build the farm up from there.
In a slime chunk, slimes spawn below Y-level 40 (Source: Minecraft Wiki).