What I learned from years of trying:
I can't take melatonin and most sleep meds. I am using natural methods but if you can tolerate OTC sleep pills or sleep meds, they could be your ticket. GABA, L-theanine, and some other supplements help me, but give me nightmares. They are worth a try.
Avoiding blue light for a few hours before bed helps me. Sunlight within 15-30 minutes of waking in the morning helps. Get it within 5-15 minutes if you can, and I'm not sure but I think through a window isn't enough. It has to kind of hit your eyes and you can't have sunglasses on. A sunlight simulator helps but not like the real sun.
The light avoidance and sunlight isn't enough for me, but if you force yourself to do it for weeks, it can reset your pattern. But melatonin is a lot easier. If you are trying to reset your pattern I say it's a must to watch your D3 timing.
Avoiding vitamin D3 in the late afternoon, evening, and night helps. D3 is in most dairy and some dairy subsitutes. Taking vitamin D3 within an hour of waking helps.
I also feel it is important to watch your energy envelope closer if you are trying to reset your sleep wake pattern. I don't have the energy to explain in detail, but for me the amount of physical activity and the amount I pushed yourself in a day is very closely related to how sleepy I am at the end of the day, whether I need a nap, how much sleep I need to feel rested, and how much sleep I can get by on. So I would try to develop a pattern.
I also am very benefitted by having someone to wake me up on some days, and being sure to have good sleeping conditions where little will wake me before I'm ready.
Magnesium about 60-90 minutes before bed helps me, especially if I take more like 600mg instead of only 250mg, and don't take it during the day. Avoiding some other "wakeful" vitamins and foods helps a little.
I would carefully analyze what you are eating and drinking. For example I found even decaf tea can keep me awake for 5 hours. I feel many fruits and vegetables are "wakeful". If you aren't sensitive to meds and supplements, you may not be sensitive to food and other stuff like I am.
Brushing my teeth is a "wakeful" activity, especially if using peppermint toothpaste, so I have to plan more carefully and not brush soon before bed.
Deficiencies in vitamins could cause problems. Allergies that are not well treated could too. I cannot sleep unless I have my allergy pills.
I also need to eat enough food before bed. Sleep experts say not to, but there is a PR thread about many of us needing to have a full stomach right before bed.
Resistant starch (RS2) helps me the most. More than the above combined. It is not a magic bullet but my sleep times are horrible without it and the effect I get is consistent. I had sleep problems for 20 years and I still have them if I miss my RS2 for a few days, or go against too much of my other advice in this post.
You will have to see that big RS2 thread on here, or Google because I can't explain in detail.
It doesn't work immediately. It starts working for me only after about the 3rd dose. If it doesn't work for you, you may be "feeding an empty cage" or "feeding vipers".
I was so excited about RS2 because of how much it helps some people, and it was kind of disappointing I don't get more effect, however, maybe I'd get more if I could use higher doses and get more RS3 and RS1. I still take lower doses only.
I follow the instructions and don't take it daily, and watch what food you put into your gut with the RS2. As I said, it doesn't help me the first 2 days or more. Also when it starts working it helps set my bedtime but not fix some other problems.
When I take RS2, the effect is I get sleepy around 11pm. I wish there was more flexibility, in that sometimes I would like to choose to go to sleep at, say midnight. I can only go without and be up til 2-4am, or take it and be sleepy at 11pm, no matter what time I take it, and no matter if I am just breaking out of an afternoon wakeup.
Even with the RS2, it helps me to have a certain activity before bed, like reading some duller material. I am very bad at turning off my negative thoughts, so I need something to do right before sleep. Enough to keep some interest but not enough that I want to stay awake for it. Many times I have mistakenly used interesting reading material and been up until 6am.