There are two main causes for the lack of hot water, both of which would not require replacement of the whole water heater unit. The first would be if you have an electric water heater one of the heating elements may not be operating properly or the thermostat has malfunctioned and would need to be replaced. The other main reason would be that the dip tube has broken off inside the tank and is now allowing the incoming cold water to mix with the hot water instead of being forced to the bottom, this is true for both gas and electric water heaters.