  We describe a method to obtain $\mathrm{SU}(3)$-structures and
$\mathrm{G}_2$-structures on 6 and 7-dimensional manifolds respectively, such
that its associated metric is Einstein. More concretely, we have that different
classes of $\mathrm{SU}(2)$ and $\mathrm{SU}(3)$-structures, on 5 and
6-dimensional manifolds whose induced metric is Einstein can produce, via
warped products, different classes $\mathrm{SU}(3)$ and
$\mathrm{G}_2$-structures such that its associated metric is also Einstein.
