The president doesn't single-handedly control gas prices, but decisions they make have an impact on things which affect gas prices. Case in point, attacking Iran, so Iran closes the strait of Hormuz which severely reduces oil exports to the rest of the world. Trump is directly responsible for the US attacking Iran, which led to the strait being closed, so this is due to his actions.