Ideally you want to build upwards as quick as you can and cut off the slimes where they spawn, barring that you can try and build up some resources under an overhang where nothing but slime balloons can reach.
As for how to escape, exploration is the key. You need to find and talk to both of your crew mates, who are located in opposite corners of the cave.