Lots of medical issues can cause this.
See your family doctor to rule out things like thyroid problems. If medically cleared, have a psychiatric evaluation. Many psychiatric illnesses are biological illness that seem to come out of nowhere. This is not your fault! and there is help!