You have two options, both require that you have the necessary knowledge and understanding.

Option 1: Complete the square for x^2 + 4x - 8 and compare with (x + p)^2 + q.

Option 2: Expand (x + p)^2 + q and equate the coefficients of the various powers of x with the corresponding coefficients in x^2 + 4x - 8.