Welcome to Just Answer.
Sorry to hear about your problem.
Typically, if you have hot water then the elements are working fine. If you do not have any hot water, then it may be the upper element that is defective or the upper thermostat. If you are running out of hot water quickly, then it may be the lower element that is defective or the lower thermostat or the dip tube.
You can test the elements to see if they are defective (even if they are new), with an Ohm-meter. You will get a reading of about 100 ohms or higher across a good element. If the needle on the meter doesn't move, then you have a bad element. If the element checks out good, then replace the thermostat. You can also measure the resistance from the element connections to the tank; they should be open and any reading indicates a bad element that is shorted to ground.
In addition, keep this in mind-- thermostats fail more often then the heating elements. Anytime there is a problem, the thermostats should be checked first. It's also not a bad idea to change the thermostats (even if they test good,) if you are changing the elements.
In every water heater, there is a plastic dip tube that brings cold water to the bottom of the tank to be heated and prevents it from mixing with the already heated water at the top of the tank. If the tube splits or breaks, then cold mixes with hot and suddenly your water heater doesn't work like it used to. You have the option to replace this part which can restore your tank's function and save you the cost of a new heater or you can simply replace the water heater; which ever makes more sense, depending on the condition of the rest of the water heater.
Click here to learn more of how the dip tube works and how to replace it.
If you need further help or clarification on this answer, please do not hesitate to reply to this post.
Thanks for asking your question at Just Answer.
Best of Luck, Brian
Please leave feedback at your convenience.