For supported lanterns, place the lantern on the side of the block, and the lantern will attach to that side.
Lantern's that inherit from vanilla's lantern are automatically supported through a dynamic block entity. This does not cover every lantern, but it should cover most.
For developers: