When the economy shuts down, as it did during COVID, demand obviously drops hard, and so do prices. It's a rough way to get cheap gas obviously.
When the economy heats up, as it did post COVID, demand rises faster than supply, in general, and we're seeing near record high oil prices globally, not just here in the US.
The actions by a President can influence pricing some, but the larger increases are due to increased demand outstripping supply. US oil production should be at record levels next year unless we hit a recession in the interim, and prices would still be quite high.
Just in general, I think "we" credit and blame Presidents for what happens which often is largely out of their control. The Fed, in my view, has more influence over the economy except for decisions like going to war etc.