Dear Friend, thanks for reaching out here for help. Depression and insomnia are interlinked. Any disturbances in mind can also cause bodily disturbances and visa versa. Your concerns on self esteem could also be a reason for depression. So it's important to understand this through a proper assessment or evaluation by counseling Psychologist. Then he can suggest you the options to recover.
Next Steps
You can consult me online or reach out to any psychology counselor nearby.