Why my mesh is getting messed up? Is it because weight paint or is it something else? I have tried making it right with weight paint but it's still not working. Should I add more geometry to the leg part? Like adding few more vertices around the knee?
Your mesh is super messy, you have a lot of inner faces + you need to join vertices to make nice quads and edge loops all around the legs.