Take the back off the toilet, and try to flush it. You should easily be able to see where the problem is. Is the tank not filling? Is the handle not pulling on the chain? Is the flapper not closing completely? Pull or push any parts that seem to be stuck or bent and that may take care of the problem.
If simply making adjustments or reattaching things like the chain does not fix the problem, you might have to actually replace some parts. To do this, turn off the water to the toilet at the valve underneath the tank. Then manually flush the toilet to drain the tank, or scoop the water out of the tank with a cup. The water may look gross, but it is generally clean.
If any part is actually broken, remove it and the surrounding parts attached to it. Most of the time, just a screwdriver or pair of pliers are needed to remove parts from the back of the toilet. Some parts can just be pulled gently from their holders. A plumber's wrench might be necessary if you have to remove the entire flushing mechanism.
Take the old parts to the hardware or plumbing supply store and replace them. Be especially careful with the height of the flushing mechanism as different toilets have taller ones than others. Ask for help if you are unsure about which parts to buy.
The new parts should install just as easily as the old parts came out. Tighten everything to a hand tightness. Do not over-tighten, as this may crack plastic parts. Adjust the float and the water hose as necessary. Make certain the chain has a little slack but not too much. Make certain no parts rub against the side of the toilet. Bend or adjust parts as necessary.
At the valve under the toilet tank, turn the water back on, and let the tank fill. Try to flush the toilet. See if it flushes properly. Flush two or three times before putting the back of the tank on again. Manipulate any parts that are not working properly until the tank fills and flushes correctly.