The given quadratic equation is:
\[
x^2 - 5x + p = 10.
\]
We can rewrite this equation as:
\[
x^2 - 5x + (p - 10) = 0.
\]
Let the roots of the equation be \( \alpha \) and \( \beta \). According to Vieta's formulas, the sum and product of the roots for a quadratic equation \( ax^2 + bx + c = 0 \) are given by:
\[
\alpha + \beta = -\frac{b}{a}, \quad \alpha \beta = \frac{c}{a}.
\]
For the equation \( x^2 - 5x + (p - 10) = 0 \), we have \( a = 1 \), \( b = -5 \), and \( c = p - 10 \).
- The sum of the roots is:
\[
\alpha + \beta = -\frac{-5}{1} = 5.
\]
- The product of the roots is:
\[
\alpha \beta = \frac{p - 10}{1} = p - 10.
\]
We are told that the product of the roots is 6:
\[
\alpha \beta = 6.
\]
Thus:
\[
p - 10 = 6 \quad \Rightarrow \quad p = 6 + 10 = 16.
\]
Therefore, the value of \( p \) is \( \boxed{6} \).