I gave up caffeine on a lark during lockdowns. Man, great decision. I've never slept better and my anxiety went way down too. I'd had no idea what that stimulant happened to be doing to my system.
I had been tapering down my caffeine consumption too, but going cold turkey had a major difference for me.
I'll caution that 3 days of pretty intense headaches were the cost, but for me, the benefits were immense.
I still go through a coffee ritual-thingy in the mornings with teas, so that is still nice to have.
Others in my family have tried this, but saw no real benefits, so went back on coffee. Your mileage may vary too. Still, I think it's worth a shot if you're having sleeping issues.