Get into the prison by either letting yourself get caught by removing your collar and being seen by a magister ( The Arena of Fort Joy), or through the ancient tunnel (learn the location by completing The Imprisoned Elf), or through the quest Withermoore's Soul Jar (not needed to find the tunnel).You will find yourself at the beach, on the other side of the coast. If you choose to go north once inside the gates, you can meet a paladin near the port who is also fighting magisters. The straightforward way is to kill the 4 magisters at the gate, pick up the key, make your way inside the fort, then you can fight your way out.
This quest is automatically acquired at the start of Chapter II. Escape from Fort Joy is a Quest in Divinity: Original Sin II and it is formerly known as The Escape and Fort Joy.