A good formula for guaranteeing ripped clothes is buying a somewhat tight pair of pants from any fast fashion brand, cycling daily, and letting these pants be your only pair for all occasions — weddings, bar mitzvahs, swimming, etc.
To fix: cut a piece of cloth from the other pair of pants, pin the patch inside the hole of the pants you want fixed, and go nuts with some needle and thread.
Video: Invisible mending - How to patch a rip or tear in jeans and pants
Article: How to fix holes in Jeans
"Most of the fixing of holes in jeans involves sewing a patch that will cover the hole. A patch is an extra piece of fabric attached on another fabric – this piece of fabric should be large enough to cover the hole – it can be matching the base fabric to blend in or a contrasting one which will stand out."