[proofplan]
Realize the representation attached to $f$ as the $f$-isotypic Hecke summand of the first $l$-adic étale cohomology of the modular curve $X_0(N)$. For a prime $p \nmid Nl$, the modular curve has smooth proper reduction at $p$, so smooth proper base change implies that inertia at $p$ acts as the identity on this cohomology. Since the Hecke projection commutes with the Galois action, the same identity action holds on the $f$-isotypic component and hence on the two-dimensional representation $\rho_{f,\lambda}$.
[/proofplan]
custom_env
admin
[step:Realize $\rho_{f,\lambda}$ inside the étale cohomology of $X_0(N)$]Let $X$ denote the modular curve $X_0(N)$ over $\mathbb{Q}$. Let
\begin{align*}
H:=
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}},\mathbb{Q}_l)\otimes_{\mathbb{Q}_l}K_{f,\lambda}.
\end{align*}
The absolute [Galois group](/page/Galois%20Group) $G_{\mathbb{Q}}:=\operatorname{Gal}(\overline{\mathbb{Q}}/\mathbb{Q})$ acts continuously and $K_{f,\lambda}$-linearly on $H$ by functoriality of étale cohomology.
Let $\mathbb{T}$ be the Hecke algebra generated by the Hecke correspondences on $X_0(N)$ away from $N$. The action of $\mathbb{T}$ on $H$ commutes with the $G_{\mathbb{Q}}$-action because the Hecke correspondences are defined over $\mathbb{Q}$. Let
\begin{align*}
e_f: H \to H
\end{align*}
be the Hecke idempotent cutting out the $f$-isotypic summand after extension of scalars to $K_{f,\lambda}$. Then $e_fH$ is a $G_{\mathbb{Q}}$-stable $K_{f,\lambda}$-[vector space](/page/Vector%20Space).
By the standard cohomological construction of the Galois representation attached to a weight two newform, $\rho_{f,\lambda}$ is obtained from the two-dimensional semisimple $G_{\mathbb{Q}}$-representation occurring in $e_fH$.[/step]
custom_env
admin
[guided]The representation $\rho_{f,\lambda}$ is not constructed abstractly; in weight two it comes from the geometry of the modular curve. We take
\begin{align*}
H:=
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}},\mathbb{Q}_l)\otimes_{\mathbb{Q}_l}K_{f,\lambda},
\end{align*}
where $X=X_0(N)$ is the modular curve over $\mathbb{Q}$. Étale cohomology is functorial under automorphisms of the [algebraic closure](/page/Algebraic%20Closure) $\overline{\mathbb{Q}}$, so $G_{\mathbb{Q}}$ acts continuously and $K_{f,\lambda}$-linearly on $H$.
The Hecke operators also act on $H$, because they are induced by algebraic correspondences on the modular curve. These correspondences are defined over $\mathbb{Q}$, so their action commutes with the action of $G_{\mathbb{Q}}$. Therefore the Hecke eigenspace determined by $f$ is preserved by Galois. More precisely, after extending scalars to $K_{f,\lambda}$, the Hecke idempotent
\begin{align*}
e_f: H \to H
\end{align*}
projects onto the $f$-isotypic summand, and the commutation relation between Hecke and Galois implies that $e_fH$ is $G_{\mathbb{Q}}$-stable.
The standard weight two construction of $\rho_{f,\lambda}$ identifies the attached two-dimensional semisimple representation with the relevant Galois constituent of $e_fH$. Thus, to prove that $\rho_{f,\lambda}$ is unramified at $p$, it is enough to prove that inertia at $p$ acts as the identity on $H$.[/guided]
custom_env
admin
[step:Use smooth proper base change to make inertia act as the identity on cohomology]Let $p$ be a rational prime with $p\nmid Nl$. Let $I_p\subset G_{\mathbb{Q}}$ denote the inertia subgroup at $p$, defined after choosing an embedding $\overline{\mathbb{Q}}\hookrightarrow \overline{\mathbb{Q}}_p$.
Since $p\nmid N$, the modular curve $X_0(N)$ has smooth proper reduction over $\mathbb{Z}_p$. Let $\mathcal{X}$ be a smooth proper model of $X$ over $\mathbb{Z}_p$, let $\mathbb{F}_p$ be the residue field of $\mathbb{Z}_p$, and let
\begin{align*}
\mathcal{X}_{\overline{\mathbb{F}}_p}:=
\mathcal{X}\times_{\operatorname{Spec}\mathbb{Z}_p}\operatorname{Spec}\overline{\mathbb{F}}_p
\end{align*}
be the geometric special fibre. Since $p\neq l$, smooth proper base change applies to $\mathcal{X}/\mathbb{Z}_p$ with $\mathbb{Q}_l$-coefficients. It gives a $G_{\mathbb{Q}_p}$-equivariant identification
\begin{align*}
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}_p},\mathbb{Q}_l)
\cong
H^1_{\mathrm{\acute{e}t}}(\mathcal{X}_{\overline{\mathbb{F}}_p},\mathbb{Q}_l),
\end{align*}
where the action on the right factors through
\begin{align*}
G_{\mathbb{F}_p}:=\operatorname{Gal}(\overline{\mathbb{F}}_p/\mathbb{F}_p).
\end{align*}
The inertia subgroup $I_p$ is the kernel of the natural map $G_{\mathbb{Q}_p}\to G_{\mathbb{F}_p}$. Hence $I_p$ acts as the identity on
\begin{align*}
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}_p},\mathbb{Q}_l).
\end{align*}
After tensoring with $K_{f,\lambda}$, $I_p$ acts as the identity on $H$.[/step]
custom_env
admin
[guided]We now use the good reduction hypothesis. The condition $p\nmid N$ is exactly what ensures that the modular curve $X_0(N)$ has smooth proper reduction at $p$. Thus there is a smooth proper scheme $\mathcal{X}$ over $\mathbb{Z}_p$ whose generic fibre is $X$ after base change to $\mathbb{Q}_p$.
The condition $p\nmid l$ is the second necessary hypothesis: smooth proper base change for étale cohomology applies with $\mathbb{Q}_l$-coefficients only when the coefficient prime $l$ is different from the residue characteristic $p$. Applying smooth proper base change to $\mathcal{X}/\mathbb{Z}_p$ gives an identification
\begin{align*}
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}_p},\mathbb{Q}_l)
\cong
H^1_{\mathrm{\acute{e}t}}(\mathcal{X}_{\overline{\mathbb{F}}_p},\mathbb{Q}_l).
\end{align*}
This is the point where both exclusions, $p\nmid N$ and $p\nmid l$, are used.
The Galois action on the special fibre is an action of the residue-field Galois group
\begin{align*}
G_{\mathbb{F}_p}:=\operatorname{Gal}(\overline{\mathbb{F}}_p/\mathbb{F}_p).
\end{align*}
Under the specialization map $G_{\mathbb{Q}_p}\to G_{\mathbb{F}_p}$, the inertia subgroup $I_p$ is precisely the kernel. Therefore every element of $I_p$ acts as the identity on the special-fibre cohomology, and by the base-change identification it also acts as the identity on
\begin{align*}
H^1_{\mathrm{\acute{e}t}}(X_{\overline{\mathbb{Q}}_p},\mathbb{Q}_l).
\end{align*}
Extending scalars from $\mathbb{Q}_l$ to $K_{f,\lambda}$ does not change whether an operator is the identity, so $I_p$ acts as the identity on $H$.[/guided]
custom_env
admin
[step:Pass the identity inertia action to the $f$-isotypic summand]
Because $e_f$ commutes with the $G_{\mathbb{Q}}$-action, it commutes in particular with the restriction of the action to $I_p$. Since every element of $I_p$ acts as the identity on $H$, every element of $I_p$ acts as the identity on the $G_{\mathbb{Q}}$-stable subspace $e_fH$.
Let $V_{f,\lambda}$ denote the two-dimensional semisimple $K_{f,\lambda}$-representation of $G_{\mathbb{Q}}$ attached to $f$ inside $e_fH$. The restriction of the $I_p$-action to any subrepresentation, quotient representation, or semisimplification of a representation on which every element of $I_p$ acts as the identity again has every element of $I_p$ acting as the identity. Hence
\begin{align*}
\rho_{f,\lambda}(\sigma)=I_2
\end{align*}
for every $\sigma\in I_p$, where $I_2$ is the identity matrix in $GL_2(K_{f,\lambda})$.
Thus every element of $I_p$ acts as the identity under $\rho_{f,\lambda}$. Since $p\nmid Nl$ was arbitrary, $\rho_{f,\lambda}$ is unramified at every rational prime $p\nmid Nl$.
[/step]