Pull the washing machine away from the wall to give you room to work.
Check the drain pipe. Most drain pipes are installed with the top higher than the water level of a standard washing machine in order to prevent water from running back into the washing machine. Standard drain pipes are 2 inches in diameter and prefabricated to accept most washing machine drain hoses.
Check your drain hose. Local codes generally require washing machine drain hoses to be 34 inches in length. Most hoses come pre-bent so they can fit snugly into the drain pipe. In many cases, the hose will stay in place just because of the fit and bend of the hose.
If your drain hose isn't staying in place, the easiest fix for beginners is to insert the hose into the drain pipe and then wrap duct tape around the hose and pipe where they meet. Both the pipe and the hose must be dry when you apply the tape. This usually will take care of the problem.
A more complicated, but not difficult, fix is to clamp the hose to the nearest wall. This will entail purchasing a hose clamp and a screw to attach it to the wall. Place the end of the hose in the pipe and then affix the clamp around the hose, about six inches from the top of the drain pipe. The loose end of the tightened clamp can then be attached to the nearest wall. If a wall stud is nearby, this is the best way to attach the clamp. Simply screw through the loose end of the clamp into the stud. If the wall is drywall, you must drill an anchor hole, insert a plastic anchor, and then screw the clamp end into the anchor. If the wall is brick or masonry, you must drill into the surface with a masonry bit and then insert the anchor. Then attach the screw and tighten the clamp end into the anchor.