The graph specifically highlights two points that might interest us in obtaining the equation. They are x=0 and x=1.
For x=0, h(x) = 6 {obtained from the graph} h(x) = 6 = a*b^0 Implies, a=6, since anything to the power 0 is 1, therefore b^0 is 1.
For x=1, h(x) = 4 {obtained from the graph} h(x) = 4 = 6*b^1 {a substituted by 6} Implies, 4=6*b, since anything to the power 1 is itself, therefore b^1 is b.