This might be a really dumb question but I am trying rigging out and I keep getting this weird folding glitches. I am trying to fix it with weight painting? But is there something else I should be doing?
After looking at your file, it turns out that the vertex weights have some irregularities. This was quick and easy to fix by simply starting the skinning process over again.
Start by going into in Object Mode, select the armature, then click on the Object Data tab in the Properties Panel, go to the Skeleton section, and press the Rest Position button to get your armature into its default pose. We do this to prepare it for proper skinning.
Next, while still in Object Mode, click on the Modifiers tab, find the armature modifier and press the Apply button, thereby essentially getting rid of it. Now click on the Object Data tab in the Properties Panel, and go to the Vertex Weights section. There is a little dark button with a white "down" arrow on it, to the far right of this section. Click on it, and from the popup menu, choose to Delete All Groups.
Next, while still in Object Mode, select the character mesh, then Shift + select the armature, then press Ctrl + p, and from the Parent menu, choose Armature Deform With Automatic Weights. Finally, go back to the Skeleton section and press the Pose Position button to re-enable your rig for posing and animation. If you forget this step, you won't be able to move your rig, and your animation won't even play.
I find that this works. More tweaks may be needed, though. One thought I had was that as clean as your mesh is, the topology might be able to be improved somewhat. But overall, the mesh isn't bad. With a bit of weight painting, it may be good enough like it is.