The reduction half-reaction for a metal electrode is given by: $M^{n+}(aq) + ne^- \rightarrow M(s)$.
According to the Nernst equation,the electrode potential at any concentration is given by:
$E_{(M^{n+} \mid M)} = E^{\circ}_{(M^{n+} \mid M)} - \frac{RT}{nF} \ln \frac{[M(s)]}{[M^{n+}(aq)]}$.
Since the concentration of a pure solid is taken as unity $([M(s)] = 1)$,the equation simplifies to:
$E_{(M^{n+} \mid M)} = E^{\circ}_{(M^{n+} \mid M)} - \frac{RT}{nF} \ln \frac{1}{[M^{n+}(aq)]}$.
Alternatively,using base $10$ logarithm at $298 \ K$:
$E_{(M^{n+} \mid M)} = E^{\circ}_{(M^{n+} \mid M)} - \frac{0.0591}{n} \log \frac{1}{[M^{n+}(aq)]}$.