Recall in discrete case, any operator A^\hat{A} has a matrix representation. Discrete matrix representation

A^=∑m,n∣m⟩⟨m∣A^∣n⟩⟨n∣=∑n,mAmn∣m⟩⟨n∣\hat{A}=\sum_{m,n}\ket{m}\bra{m}\hat{A}\ket{n}\bra{n}=\sum_{n,m}A_{mn}\ket{m}\bra{n} ∣ϕ⟩=A^∣ψ⟩⇒ϕm=∑nAmnψn\ket{\phi}=\hat{A}\ket{\psi}\Rightarrow \phi_m=\sum_nA_{mn}\psi_n

Continuous matrix representation

∣ϕ⟩=A^∣ψ⟩\ket{\phi}=\hat{A}\ket{\psi}

\Rightarrow \phi(x)=\braket{x|\phi}=\bra{x}\hat{A}\ket{\psi}=A(x,y)

=\int\bra{x}\hat{A}\ket{y}\braket{y|\psi}dy

=\int A(x,y)\psi(y)dy

=\int\phi^*(x)\psi (x)~(dx)