So just in case my character goes to jail and I fail sneaking can I use magic without having to get my stuff from the prisoners chest and items?
The best two spells to use are "Muffle" and "Invisibility".
"Muffle" allows you to walk silently for 3 minutes (180 seconds) and "Invisibility" makes you completely unseen for 30 seconds (75 seconds if you dual cast it).
Make sure you stand up before opening your chest as opening the chest will remove the invisibility spell).
Take your items and cast invisibility again. Then immediately crouch. Guards will no longer notice you and you can freely sneak away.