You seem to have a Major Depressive Disorder. You will regain your confidence, motivation, and happiness in general with the help of medication.
Taking counseling along with medication may also help.
I appreciate that you acknowledged the problem as a problem. This is the first step for betterment.
Next Steps
Visit a Psychiatrist.
Health Tips
Do not delay getting treated. Medication will not be given for lifetime. You will have to use for 6-9 months more or less according to your symptom profile. You will have noticeable results in just few weeks.