I understand that different atoms have specific electronic configurations that allow them to absorb specific energies of photons, so their electrons can excite and deexcite in steps to release photons of particular frequencies. However I am confused as to what happens to the other wavelengths of light as they strike for example a blue solid. My understanding from my textbook is that electrons will only absorb the energy of a photon if it is exactly the same as the energy difference between energy levels in an atom. What happens to all the other wavelengths? What are they being absorbed by? Do they just deflect off but then if so why don't I see the jumbled up mess of reflected colours. I hope my question actually makes sense but I am honestly just confused by this concept of 'absorbing' certain wavelengths. And if they are absorbed wouldn't they just deexcite straight away releasing potentially a variety of wavelengths depending on the atom. My understanding previously was that electrons will only absorb certain energy photons. However I saw something that said "the wavelengths of light that aren't absorbed will contribute to the complementary colour of the object". I suppose this makes much more sense to me when I think of a gas instead of a solid for some reason.
Let's take as an example of your blue solid a piece of blue glass. What happens when white light shines on it? The red-orange-yellow-green part of the spectrum is absorbed, this is something you seem to already understand. Now the remaining part of the spectrum, cyan-blue-violet, is not absorbed. Instead, it's partially transmitted through the glass, and partially reflected (following the Fresnel equations). Thus the piece of glass looks blue by itself (due to reflection), and a spot of light, if you block a white spotlight with this glass, will also look blue (due to transmission).
If we take a rough object instead of a shiny piece of glass—e.g. a piece of blue paper, it'll transmit less light, and instead of reflecting, it'll scatter the light that it doesn't absorb. This will remove the shininess you could observe on the glass, but the paper by itself will still look blue.
This reflection/scattering is exactly what gives you the complementary color of the object—complementary to the absorption spectrum.
...will only absorb the energy of a photon if it is exactly the same as the energy difference between energy levels in an atom.
For a transparent container full of atomic hydrogen this picture is accurate. Only some wave lengths can be absorbed, and soon later emmited.
But for most of the objects, the atoms are part of large molecules (plastics, paper, wood) or are bound in crystalline structures (metals). The range of wave lengths that can be absorbed is much greater because it is not a property of the atoms alone, but of the whole structure.
Laying white, black, or coloured tiles under the sun it is possible to measure the different temperatures they reach. The black ones become hotter due to greater absorption.