[proofplan]
We invoke the Breuil--Conrad--Diamond--Taylor modularity theorem in its standard newform formulation: every elliptic curve over $\mathbb{Q}$ of conductor $N$ is attached to a normalized weight $2$ newform of level $N$. That theorem gives a newform whose $L$-function equals the Hasse--Weil $L$-function of the elliptic curve. Comparing the Euler factors at primes $p \nmid N$ then identifies the Hecke eigenvalue of $T_p$ with the trace of Frobenius $a_p(E)=p+1-|E(\mathbb{F}_p)|$.
[/proofplan]
[step:Apply the modularity theorem in newform form]
Let $E/\mathbb{Q}$ be the elliptic curve in the statement, and let $N \in \mathbb{N}$ be its conductor. Let $\mathfrak{H}=\{z \in \mathbb{C}:\operatorname{Im}(z)>0\}$ denote the complex upper half-plane. The Breuil--Conrad--Diamond--Taylor modularity theorem states that every elliptic curve over $\mathbb{Q}$ of conductor $N$ is modular of level $N$: there exists a normalized newform
\begin{align*}
f: \mathfrak{H} &\to \mathbb{C}
\end{align*}
in $S_2(\Gamma_0(N))$ whose Fourier expansion has rational Hecke eigenvalues and whose automorphic $L$-function is the Hasse--Weil $L$-function of $E$. Applying that theorem to the given curve $E/\mathbb{Q}$ gives a newform $f \in S_2(\Gamma_0(N))$ with rational Hecke eigenvalues such that
\begin{align*}
L(E,s)=L(f,s).
\end{align*}
This proves the first formulation of the theorem.
[guided]
The hypothesis that $E$ is an elliptic curve over $\mathbb{Q}$ and that $N$ is its conductor is exactly the input required by the Breuil--Conrad--Diamond--Taylor modularity theorem. Let $\mathfrak{H}=\{z \in \mathbb{C}:\operatorname{Im}(z)>0\}$ denote the complex upper half-plane. In the form needed here, that theorem says: if $E/\mathbb{Q}$ is an elliptic curve of conductor $N$, then $E$ is associated with a normalized weight $2$ newform of level $N$. Concretely, it gives a holomorphic cusp form
\begin{align*}
f: \mathfrak{H} &\to \mathbb{C}
\end{align*}
with $f \in S_2(\Gamma_0(N))$, with rational Hecke eigenvalues, and with the equality of completed Euler products encoded by
\begin{align*}
L(E,s)=L(f,s).
\end{align*}
Thus the existence of the required newform is not constructed by an elementary calculation inside this proof; it is precisely the content of the modularity theorem proved by Wiles, Taylor--Wiles, and Breuil--Conrad--Diamond--Taylor. The present theorem is the standard analytic formulation of that result for elliptic curves over $\mathbb{Q}$.
[/guided]
[/step]
[step:Compare Euler factors away from the conductor]
Let $p$ be a prime with $p \nmid N$. Since $p$ is a prime of good reduction for $E$, define
\begin{align*}
a_p(E)=p+1-|E(\mathbb{F}_p)|.
\end{align*}
For such $p$, the local Euler factor of $L(E,s)$ is
\begin{align*}
L_p(E,s)=\left(1-a_p(E)p^{-s}+p^{1-2s}\right)^{-1}.
\end{align*}
Because $f$ is a normalized newform, it is an eigenvector for the Hecke operator
\begin{align*}
T_p:S_2(\Gamma_0(N))&\longrightarrow S_2(\Gamma_0(N)),
\end{align*}
and we write $a_p(f) \in \mathbb{Q}$ for the eigenvalue defined by $T_p f=a_p(f)f$. The $p$-Euler factor of $L(f,s)$ is
\begin{align*}
L_p(f,s)=\left(1-a_p(f)p^{-s}+p^{1-2s}\right)^{-1}.
\end{align*}
The modularity theorem is being used in its strong newform formulation: the equality $L(E,s)=L(f,s)$ is an equality of Euler products with matching local factors at every prime. Therefore, at the fixed prime $p \nmid N$, the good-prime Euler factors agree, hence
\begin{align*}
1-a_p(E)p^{-s}+p^{1-2s}=1-a_p(f)p^{-s}+p^{1-2s}.
\end{align*}
Comparing the coefficients of $p^{-s}$ gives $a_p(f)=a_p(E)$, and therefore
\begin{align*}
T_p f=a_p(E)f.
\end{align*}
This proves the stated Hecke-eigenvalue formulation.
[guided]
We now explain why the equality of $L$-functions gives the concrete Hecke eigenvalue statement in the theorem. Let $p$ be a prime satisfying $p \nmid N$. This condition means that $E$ has good reduction at $p$, so its local Euler factor is determined by the point count over $\mathbb{F}_p$. Define
\begin{align*}
a_p(E)=p+1-|E(\mathbb{F}_p)|.
\end{align*}
The good-prime Euler factor of the Hasse--Weil $L$-function is then
\begin{align*}
L_p(E,s)=\left(1-a_p(E)p^{-s}+p^{1-2s}\right)^{-1}.
\end{align*}
On the modular-form side, $f$ is a normalized newform in $S_2(\Gamma_0(N))$. Newforms are simultaneous eigenvectors for the Hecke operators away from the level. Therefore, for the linear operator
\begin{align*}
T_p:S_2(\Gamma_0(N))&\longrightarrow S_2(\Gamma_0(N)),
\end{align*}
there is a scalar $a_p(f) \in \mathbb{Q}$ such that
\begin{align*}
T_p f=a_p(f)f.
\end{align*}
The corresponding Euler factor of the newform $L$-function is
\begin{align*}
L_p(f,s)=\left(1-a_p(f)p^{-s}+p^{1-2s}\right)^{-1}.
\end{align*}
The modularity theorem already gave $L(E,s)=L(f,s)$ in its newform formulation, meaning equality of Euler products with the local factor of $E$ matched to the local factor of $f$ at each prime. This is the point that justifies comparing a single prime: we are not extracting a local identity from an unspecified global analytic equality, but using the local compatibility included in the modularity theorem. At primes $p \nmid N$, the two local factors have the same quadratic shape, so equality of the local factors gives
\begin{align*}
1-a_p(E)p^{-s}+p^{1-2s}=1-a_p(f)p^{-s}+p^{1-2s}.
\end{align*}
The constant terms and the $p^{1-2s}$ terms agree, so comparing the coefficient of $p^{-s}$ yields
\begin{align*}
a_p(f)=a_p(E).
\end{align*}
Substituting this equality into $T_p f=a_p(f)f$ gives
\begin{align*}
T_p f=a_p(E)f,
\end{align*}
which is the equivalent formulation in the theorem statement.
[/guided]
[/step]