If you see dirt in the viewfinder it will be from either the ground glass (sharp) or the mirror (diffuse). Dirt on the sensor will be most visible when at a high f number. Dirt on the back of the lens will show as very diffuse blobs of low contrast, not as sharp spots or hairs. Cleaning the lens can be done with a clean microfiber cloth and lens spray, sensor cleaning kits, with a fluid and applicator can be used on the sensor, don't us brushes on the sensor. Air puffers (like the one linked) are also useful for cleaning lenses and sensors, don't us canisters of compressed air as the liquid accelerant in the can, can spit out on the sensor.
If you don't want to do it yourself you can get the camera cleaned at a camera shop/canon
https://www.amazon.com/dp/B01FWNEUIM/ref=sspa_mw_detail_2?psc=1
Bought this for my D750 (comes in full frame and aps-c size swabs). Good price, quality products in the kit and the seller has a how to video that’s very informative and helpful if you’ve never cleaned your sensor before (search digitalgoja). 10/10 been recommending this ever since I bought it.
Agreed with the other user. First try a rocket blower or something on the sensor, if the problem persists I'd suggest giving a sensor cleaning a try.
I used this kit for my D7000 and D500 and it worked well.
https://www.amazon.com/Altura-Photo-Professional-Cleaning-Cameras/dp/B01FWNEUIM/
The first thing I wouldn't buy, whatever fluid it comes with is probably unnecessary. I'd get something with a lens pen, they're hella convenient, brush on one side, other side for greasy smudges. You can just throw the lens pen in your pocket when you go shoot as well. A blower can be very useful as well, but since it's not too practical to put the blower in your pocket, I wouldn't get a blower that's combined with your brush. This cleaning kit is really good for the money since it comes with sensor cleaners as well Altura Photo Professional Cleaning Kit for DSLR Cameras and Sensors Bundle with APS-C Sensor Cleaning Swabs and Carry Case https://www.amazon.com/dp/B01FWNEUIM/ref=cm_sw_r_other_apa_nlgezbZ3SBK65 I had bought just the brush and blower for like $8, but I wish I had seen that and got it instead. As far as filters, many people, myself included, just buy uv filters and leave them on all the time for protection. They will prevent dust from getting on the front element of your lens, but that just means it'll get on the filter instead... I wouldn't buy Polaroid ones though as they usually make shit. The Amazon basics ones are pretty cheap though and seem to be working well for me. I wouldn't bother buying lens hoods separately, just use your hand if you need it.