  Black bounces are spacetimes that can describe, depending on certain
parameters, black holes or wormholes. In this work, we use a method to obtain
the matter content that generates black bounce solutions in general relativity.
The method is constructed in a general way, and as models, we apply it to the
Simpson--Visser black bounce solution and the Bardeen-type black bounce
solution. We obtain that these metrics are solutions of Einstein's equations
when we consider the coupling of the gravitational interaction with a phantom
scalar field with a nonlinear electrodynamics. The presence of the phantom
scalar field is linked to the fact that this type of solution violates the null
energy condition. We analyze separately the energy conditions associated with
the stress-energy tensor for the scalar field and for the electromagnetic
field.
