We present a general framework to tackle quantum optics problems with giant atoms, i.e. quantum emitters each coupled it non-locally to a structured photonic bath (typically a lattice) of any dimension. The theory encompasses the calculation and general properties of Green’s functions, atom-photon bound states (BSs), collective master equations and decoherence-free Hamiltonians (DFHs), and is underpinned by a formalism where a giant atom is formally viewed as a normal atom lying at a fictitious location. As a major application, we provide for the first time a general criterion to predict/engineer DFHs of giant atoms, which can be applied both in and out of the photonic continuum and regardless of the structure or dimensionality of the photonic bath. This is used to show novel DFHs in 2D baths such as a square lattice and photonic graphene.