It strikes me as odd that you'd get 31 frames in before a loading issue cropped up...but, I guess stranger things have happened.
If you have a professional camera shop and developer in your town, simply take the whole camera to them. They will have a darkroom, dark box, etc. and will be more accustomed to removing jammed up film. They'll get it unwound, back into the can, and then it would be good of you to use their service for development.
If such a place does not exist for you, then it is on you to get the film back into the can. You will have to open the camera and then attempt to get the film off of the take-up spool. If you don't have a dedicated darkroom, then go into any room in the middle of your home with no windows. Turn off all of the lights in the home and make sure other residents will help you by maintaining the darkness. Go into the room and wait for ten minutes. Do not use your phone or a lit watch. If you can see anything, you are doing it wrong.
After 10 minutes, assess the room. If there is light leaking from the door frame, fix it any try again (I simply used a shower rod and opaque curtain to cover mine). Now that you are in the dark, open the camera and attempt to get the film off of the spool. Hopefully the spool spins in reverse and the chore is easy.
However, if the spool refuses to move, you may have to cut the film off the can in order to start unwinding it. Once cut from the can, it should be easy to unroll it from the take up spool. However, now you have a new problem - where to put the film? If you have a can for bulk loading, it would be easy to load it up in that and take to development. Or, use a change bag. If you have your own developing tank, you could use that as well. You just need something opaque and light proof to get the film from your room to the developer. If you have absolutely nothing like this, you may put the film in a small cardboard box. Put that box in another a-la nesting dolls. Then wrap the whole thing in a black garbage bag. Put that in a backpack and keep the whole thing out of direct sun. Overkill? Maybe. But, they're your photos.
Keep in mind, no matter what method you choose...it must be done in 100%, total darkness. No cheating.