I can't figure out what topology technique I'm missing. I put loop cuts in all the places where I was told to, but once I cut any holes in the hard surface the geometry falls apart. I have attached the images and hope someone can point me in the right direction.
When using a subsurf modifier, it is good practice to make sure all of your faces have exacly 4 vertices. So essentially all quads, no tris or n-gons. (this is not always necessary in all cases, but knowing when and where it is okay requires experience and/or some trial and error).
In your wireframe render, you can see that some of the longer edges get warped and twisted to intersect with your detail geometry. That causes intersecting faces and eventually Z-Fighting (the shading artifacts in your vieport). These warps are due to N-gons (faces with more than 4 verts) and/or lack of edge support.
I have painted in some additional cuts and loops here, that are likely to fix your upper problem area.
Note: This is just an example, not necessarily the best or most elegant way to do it. Good quadflow topology can be a complex puzzle and what is the best way to do it (optimize for continuous loops or minimal polycount, etc.) highly depends on the usecase. But as said, these loops as depicted will probably help with your problem.
Please also note the comment about good question titles. This is technically a subdivision issue, not a smooth shading one. I understand this is not necessarily obvious as a beginner, but you may consider editing your title to make it easier for future users who may have similar issues.
Edit: Technically you would also need to connect your lenses to quad loops for "perfect" quad geometry, like so, but depending on how close your camera gets you might be able to get away without it.