Let's define the next variables
x: number of rides
y: amount of money left
Each ride cost $2. Then, x rides cost 2x dollars.
In the beginning, Luke has $50, but after x rides he will have 50 - 2x dollars
Therefore, the equation is:
y = 50 - 2x
where the y-intercept is 50, and the slope is -2