Caffeine has a long tail
Caffeine stays in your system for hours. An afternoon coffee or energy drink can still be affecting you at bedtime even if you do not feel wired. Set a cutoff in the early afternoon and stick to it for a week before judging whether it helps. Most people notice a difference once they hold the cutoff long enough for the body to settle into it.
Watch the quiet sources too: strong tea, some soft drinks, and the second cup you take out of habit rather than thirst. If you get headaches when you cut back, step down gradually over several days rather than stopping abruptly.