I’ve had chronic insomnia for 30 years. My advice is to talk to your doctor or see a mental health professional, whichever situation fits you best. Just don’t ignore it. Not getting decent sleep can literally ruin your life.
If you go the medication route, do not be afraid to tell your doc if it’s not working well. There are lots of options and different sleep meds help different people.
Good luck!