I'm using the method of Lagrange multipliers.
The Lagrangian for this problem is given by:
$L(x,y,λ) = ax + by - λ(x^p + y^p - 1)$
Setting the partial derivatives of $L$ with respect to $x, y,$ and $λ$ equal to zero, we get:
$∂L/∂x = a - λpx^{p-1} = 0$
$∂L/∂y = b - λpy^{p-1} = 0$
$∂L/∂λ = x^p + y^p - 1 = 0$
I came to $ay^{p-1}=bx^{p-1}$ using the inicial two equations but I don't know how to use $x^p + y^p - 1 = 0$ to find the values.
All your calculus is correct you're just not using every equation consistently.
(1) $∂L/∂x = a - λpx^{p-1} = 0$
(2) $∂L/∂y = b - λpy^{p-1} = 0$
(3) $∂L/∂λ = x^p + y^p - 1 = 0$
(For $p\neq1$)
(1) $\Rightarrow$ $x=\left(\dfrac{a}{\lambda p}\right)^{1/(p-1)}$
(2) $\Rightarrow$ $y=\left(\dfrac{b}{\lambda p}\right)^{1/(p-1)}$
(1,2,3) $\Rightarrow$ $\left(\dfrac{a}{\lambda p}\right)^{p/(p-1)}+ \left(\dfrac{b}{\lambda p}\right)^{p/(p-1)}=1$
$\Rightarrow$ $\lambda=\left[\left(\dfrac{a}{ p}\right)^{p/(p-1)}+ \left(\dfrac{b}{ p}\right)^{p/(p-1)}\right]^{(p-1)/p}$
$x$ and $y$ follow. I hope that answers your question and doesn't spoil the fun of racking your brains too much.