My teacher gets me so confused but the question is 5p^2-23p+24 someone please explain

5p^2-23p+24

well 24 = 4*6 or 3*8 or 2*12 or 1*24
so what might work in
( 5 p - %%) (p - %%)

15 and 8 is 23 so try 3*5 and 8

(5 p - 8)( p - 3 )