Add a small heater to the garage or basement laundry room and keep it close to the washing machine and other appliances. The room doesn't have to be warm, it just has to stay above freezing. A fan may be helpful to circulate the warm air back behind the dryer where the pipe is.
Install foam pipe insulation material around the washer's drain pipe if it is exposed. The cylindrical foam insulation is slit on one side. Once it is cut to length, simply push the drain pipe into the insulating material to reduce the risk of freezing.
Install electric heat tape on the drain pipe. Follow manufacturer's instruction and only use tape that is Underwriter's-Laboratory approved,
Do some loads of laundry. Running water helps the pipe stay open.