We derive a general procedure for finding the electromagnetic normal modes in layered structures. We apply this procedure to planar, spherical and cylindrical structures. These normal modes are important in a variety of applications. They are the only input needed in calculations of Casimir interactions. We present explicit expression for the condition for modes and Casimir energy for a large number of specific geometries. The layers are allowed to be two-dimensional so graphene and graphene-like sheets as well as two-dimensional electron gases can be handled within the formalism. Also forces on atoms in layered structures are obtained. One side-result is the van der Waals and Casimir-Polder interaction between two atoms.