Check the water heater
A problem with water temperature might unrelated to the washer. Check your water heater to make sure it's producing hot water. Try turning on a tap near the washer to test the hot water. In addition, if you have an Energy Star-certified washer, don't forget that its hot water cycle is only going to reach 85 to 95 degrees Fahrenheit, per the standards set by the US Department of Energy.
Check the temperature selector switch
When you push a button or turn a knob to select the temperature on your washer, it activates a switch that helps to control the mix of hot and cold water that fills the washer basket. If that part fails, the basket will fill with only hot or cold water. Replacing the temperature selector switch should solve the problem.
Check the water inlet valve
Your washer fills with water through the water inlet valves. If a valve doesn't open, your washer will fill with water at the wrong temperature. It can also fail to fill at all, or it can overfill.