  The propagation of electromagnetic waves trapped within dielectric and
magnetic layers is considered. The description within the three-dimensional
theory is compared with the simplified analysis in two dimensions. Two distinct
media configurations with different topology are dealt with: a plane slab and a
hollow cylinder. Choosing the appropriate values for the geometrical parameters
(layer thickness, radius of the cylinder) and for the electromagnetic
properties of the media one can trap exactly one mode corresponding to that
obtained within the two-dimensional electromagnetism. However, the symmetry
between electric and magnetic fields suggests, that the two versions of the
simplified electromagnetism ought to be taken into account. Its usual form is
incomplete to describe all modes. It is also found that there is a domain of
optimal values of parameters for which the $2D$ model works relatively
correctly. In the case of a cylindrical surface we observe, however, several
differences which are attributed to the curvature of the layer, and which
exclude the propagation of evanescent modes. The two-dimensional
electrodynamics, whichever form used, turns out still too poor to describe the
so called `hybrid modes' excited in a real layer. The obtained results can be
important for proper description of the propagating waves within thin layers
for which $3D$ approach is not available due to mathematical complexity, and
reducing the layer to a lower-dimensional structure seems the only possible
option.
