Most washing machine user manuals will include a list of parts and, in some cases, even part numbers. You should order parts from the manufacturer if you can, as they are designed to fit your unit and are less likely to give you trouble during installation. If you have an older unit, however, this option may not be available. Many home improvement stores sell universal appliance legs. You will need to remove the old leg to get the proper size threaded bolt. Take the leg with you and ask an associate in the store for help finding a properly sized universal leg.
The washing machine will need to be raised up to gain access to the leveling leg. One easy way to do this is to use a flat board laid across a small block as a fulcrum, or seesaw. Tuck the flat board under the front lip of the washing machine. Place the small block under the flat board, so that it resembles a seesaw. Step on the area of flat board that is closest to you, and raise the washing machine as you would raise the other side of a seesaw. Place a second block of wood under the washing machine to keep it propped up while you work on the foot.
If the old leg is still in the washing machine, you will need to remove it to install the new part. Use vice grips, or a pair of pliers, to grab as much of the leg that is left, and attempt to turn it counterclockwise. The leg is basically a large bolt that is screwed in to the case of the unit. It should come out with some effort. If necessary, spray some lubricant on the leg and let it penetrate overnight before attempting to remove the leg.
Installation is the opposite of removal. Place the new leg's bolt in to the opening left by the old leg, and turn it clockwise. Once you have the leg screwed in a few turns, lift the washing machine and remove the block, allowing the unit to sit on the new leg. Check if the unit is sitting level. If it is not, lift the unit again and turn the leg further in or further out until the washing machine is sitting level and steady.