m = number of medium pizzas; each medium pizza costs $5
5m = cost of m number of medium pizzas
L = number of large pizzas; each large pizza costs $8
8L = cost of L number of large pizzas
The total cost is the sum of the cost of the medium pizzas and the cost of the large pizzas, so the total cost is 5m + 5L.
You have $45, so the total cost of the pizzas must equal $45.
The equation is
5m + 8L = 45