Whether you think of yourself as a sewing aficionado or not, repairing your own damaged clothing is a skill that can save you a lot of money in exchange for not very much time. The way to fix your pants depends on what exactly the problem is, but there are several common pants problems with relatively simple solutions
If you have a hole in your pants that is really just a gap in the stitches of a seam, you're in luck! This is probably the simplest pants problem to repair. Thread the needle and knot the ends of the thread. Turn the pants inside out and find the damaged seam and the hole. Stitch along the seam line from one end of the hole to the other, and repeat if it's in a commonly stressed area that you think may rip again easily. Tie off the thread securely and trim it near the seam.
Another relatively easy fix is a button replacement, that is, it's easy if you have an appropriate button. Prepare your thread and needle in the same way and sew up from below the fabric exactly where the button should go. Sew up and down through at least two holes of the button (or through the shank, if it's that type), and make several stitches. Try not to pull the stitches too tight, though, because the button needs a bit of flexibility. Before you finish off your thread, Wrap it several times around the bundle of threads that pass through the button, between the button and the fabric. This helps to make the attachment strong and flexible. Sew down through the fabric and secure the end of the thread.
If you have a rip in the actual fabric of your pants, this is one of the trickiest problems, but there are several possible repairs. The simplest is to turn the pants inside out, press the edges of the rip together, and sew a straight seam along them almost as though this were a torn seam. The problem with this fix is that, especially if the hold is in a commonly stressed area it can easily tear again. Also, the surrounding fabric may be thin and worn, and may tear in another place if the rip is fixed.
If you want to strengthen the area of the rip, sew it closed first and then, leaving the pants inside out, use a hot iron to attach an iron-on patch over the hole. The patch will be not very visible from the outside of the pants, but should prevent the area from becoming so stressed that the hole tears again. As long as the patch is big enough to cover the entire badly worn area, this fix is fairly effective (although you will often be able to see a faint outline of the patch through the fabric).
A final option is to patch your pants the traditional way, using normal fabric. You can do this on the inside of the pants if you don't have any iron-on patches (although it will be slightly less sturdy and more visible), or on the outside if you have a nice scrap and would like to add a decorative touch to your pants. Prepare a needle and thread, fix the patch where you want it, and fold the edges under as you sew around the patch. Sew down through the pants fabric near the patch and up through the patch nearby, repeating around all the edges of the patch until it is firmly attached.