Using tropical geometry, Mikhalkin has proved that every smooth complex hypersurface in $mathbb{CP}^{n+1}$ decomposes into pairs of pants: a pair of pants is a real compact $2n$-manifold with cornered boundary obtained by removing an open regular neighborhood of $n+2$ generic hyperplanes from $mathbb{CP}^n$. As is well-known, every compact surface of genus $ggeqslant 2$ decomposes into pairs of pants, and it is now natural to investigate this construction in dimension 4. Which smooth closed 4-manifolds decompose into pairs of pants? We address this problem here and construct many examples: we prove in particular that every finitely presented group is the fundamental group of a 4-manifold that decomposes into pairs of pants.