Metal Vs. Plastic
Many modern washer tubs are made from plastic, but some older versions are metal. It's unlikely you'll get a crack in a metal washing tub. If you do, it's caused by rust and requires replacement rather than repair, since rust in the tub can stain your clothes. You can sometimes repair a small crack in a plastic washer tub, but large cracks also require the tub be replaced.
Using epoxy meant for plastic can temporarily fix a crack in the washer tub. Work it into the crack for a better seal as well as placing a generous layer on the top. Allow the epoxy to dry according to the manufacturer's instructions before you use your washing machine. Another alternative is to use repair tape meant for plastic.
Replacing the Tub or Washer
When a quick fix isn't going to work for your situation, you'll need a replacement. You can often save money by replacing only the broken washer tub. Compare the cost of this with the cost of replacing the entire washing machine. If your washing machine is older and likely to have other problems, it may be more cost-effective to replace it.
Before doing any repairs yourself or ordering replacement parts, check with the manufacturer's warranty to see if it still covers the washing machine parts. In general, the warranty lasts a year, but your machine may be covered by an extended warranty. If you try to fix the problem yourself, you may void the warranty.