The sum of a number and the second number is 24.

We want to find the maximum product of

.
Let's solve our first equation for a.

We can substitute this in

so that we only have one variable.

Distribute.

Now we can just find the vertex of this quadratic, either putting it or vertex form or using a shortcut mentioned later. (if your teacher has already explained it to you)
Put the constant on the left side. (It's 0, so nothing to do there)
Factor out the coefficient of b².

Find which number to add to create a perfect square trinomial.
(half of -12 is -6, -6² = 36. we would add -72 to each side, so that 36 ends up inside the parentheses on the right side)

Factor the perfect square trinomial.

Isolate the p term.

The vertex is (6, 72), as vertex form is y=a(x-h)²+k where (h, k) is the vertex.
Therefore, the value of b which yields the height product p is 6.
We can plug this into a previous equation to find a.
a + 2b = 24
a + 2(6) = 24
a + 12 = 24
a = 12
a = 12, b = 6(The shortcut I was talking about is that for any quadratic f(x) = ax² + bx + c, the vertex (h, k) is (-b/2a, f(h)))