If you have been arrested for more than 3 weeks then you should have an option somewhere to drop your character and start again.
If you do not wish to drop your character and instead wish to be free you will have to talk to the faction who arrested you and seek either release or execution (the latter most likely just given not sought).
Unfortunately there is not much else you can do. If you've contacted the faction that arrested you and theiy ignore you or whatever, then you can only wait for the 3 week period before you can drop your character.
Credits and any other assets would be lost as they belong to the character you would drop. CPs would be kept as they are attached to your account and not your character.