There is a property of Legendre symbol:
$$ \sum_{0\leq k \leq p-1} \left(\frac{k^2-d}{p}\right)=\sum_{0\leq j \leq p-1}\left(1+\left(\frac{j}{p}\right)\right)\left(\frac{j-d}{p}\right) $$
with $\gcd(d,p)=1$. I already know that $$ \sum_{0\leq k \leq p-1} \left(1+\left(\frac{k^2-d}{p}\right)\right) $$
is the number of solutions for $x^2 \equiv k^2-d \pmod{p}$. I am wondering how to go from here to prove this property of Legendre symbol?
More generally, if $g$ is a function on $\mathbb Z_p$, then:
$$\sum_{k\in \mathbb Z_p} g(k^2)=\sum_{j\in \mathbb Z_p}(1+\left(\frac{j}{p}\right))g(j)$$
That's because $1+\left(\frac{j}{p}\right)$ is the number of square roots of $j$, modulo $p$.
So you can change the RHS to be:
$$\sum_{j\in \mathbb Z_p} g(j) \hspace{0.2em}\sum_{n\in \mathbb Z_p}_{n^2= j}1$$
Switching sums, you get:
$$\sum_{n \in \mathbb Z_p}\hspace{0.2em}\sum_{j\in \mathbb Z_p}_{j= n^2}g(j)$$
But the inner sum is just one term, so you get:
$$\sum_{0\leq n \leq p-1}g(n^2)$$
In your case, $g(n) = \left(\frac{n-d}{p}\right)$.