Do you have dust and foreign particles on your camera’s image sensor? If you have an interchangeable lens camera body, you probably do. But in many cases, a few random specks of dust won’t be detectable in normal photography.
However, if you have visible spots showing up in your images, you know it’s time to clean your camera image sensor. For example, in this closeup of the N2A Goodyear Blimp, if you look closely at the end of the black hand drawn arrows, you can see the results of dust on the image sensor of my second-hand A6300 camera. [Obviously, all dust is the fault of the first owner, and I can keep claiming that until after I clean it.]
Now that you know there are at least a few pieces of dust/debris on your image sensor, you can characterize just how bad the problem is by shooting a “flat” image. Point your camera towards a clear patch of sky, put the lens in manual focus mode and defocus it, and take a photo that is just slightly over exposed. [Note that to take a true astrophotography flat you need to do more than this, but for the photos below I didn’t bother. You risk having cloud shapes show up in your flat image by not having a tight white cloth over the lens….but since we are just looking for dirt it’s not critical that your flat not have gradients in it.]
If you have a lot of debris on the sensor, it will be easily visible directly in the image. In the image above, you can see I even have some type of fiber or thread (middle right). This is an example of a sensor that definitely needs cleaning. But you can also digitally enhance these images to highlight the debris more, which is useful in cases where the amount isn’t as bad. Just import it into a photo editing tool, and use the “auto adjust input levels” feature to get something like this:
With digital enhancement this looks super bad, but as you can see from the image of the Goodyear Blimp above, even this level of dust and dirt doesn’t mean you can’t take a mostly usable photo with the camera.