Let $(M,\omega)$ be a symplectic manifold. To keep it simple, let us take $M = \mathbb{R}^{2n}$ with linear coordinates $(x^1,\ldots,x^n,y^1,\ldots,y^n)$ and the standard symplectic form $\omega = \sum_{i=1}^n dx^i \wedge dy^i$.
A submanifold $\Lambda$ of $M$ is said to be Lagrangian if, for each $p \in \Lambda$, $T_p\Lambda$ is a lagrangian subspace of $T_pM$, that is, $\omega_p \vert_{T_p\Lambda} \equiv 0$ and $\dim T_p\Lambda = \frac{1}{2}\dim T_pM$. Equivalently, if $\iota : \Lambda \hookrightarrow M$ is the inclusion map, then $\Lambda$ is Lagrangian if and only if $\iota^*\omega = 0$ and $\dim \Lambda = \frac{1}{2} \dim M$.
This seems like a reasonably easy definition, but in practice, how does one really construct a lagrangian submanifold of $(M,\omega)$? For instance, given a smooth function $f : U \subset \mathbb{R}^2 \to \mathbb{R}^4$, can one explicitely construct a Lagrangian immersion out of $f$?
I read a little bit about generating functions of Lagrangian submanifolds, but am unsure if this relates here.
Thank you for your help.
Here are some facts that might help you, but I'm not sure if it is what you are looking for.
We can combine these 2 bullets to find something related to what your question is about. Let $(M_1,\omega_1)$ and $(M_2,\omega_2)$ be symplectic manifolds. Let $f\in C^\infty(M_1\times M_2)$. It follows that $df$ is a closed $1$-form on $T^\ast M_1\times T^\ast M_2$. Hence by bullet 1, we have that $\Gamma_{df}$ is a Lagrangian submanifold of $T^\ast M_1\times T^\ast M_2$, with the natural symplectic form. In fact, its not hard to show that its a Lagrangian submanifold of $(T^\ast M_1\times T^\ast M_2,\widetilde\omega)$, where $\widetilde\omega$ is the twisted product form described above.
Hence, using bullet 2, the goal is to find a diffeomorphism $\varphi:T^\ast M_1\times T^\ast M_2$ such that $\Gamma_\varphi=\Gamma_{df}$. If you can find such a $\varphi$ then you know it is a symplectomorphism and so its graph is a Lagrangian submanifold.
It's often possible, locally, to find such a $\varphi$. In fact, finding such a $\varphi$ is governed by the implicit function theorem.