You have three things to check.
1. door-frame alignment. your door should shut without rubbing against the doorframe. The frame may not be square - usually the door is always square.
2.door latch alignment. This is the normal latch (not the deadbolt). The pin sticking out of the door frame is mounted in a oversized hole. So you can loosen it, and move it up/down & in/out. The thickness of the door seal affects the in/out adjustment. Sound line your in/out needs to be adjusted if you must slam the door to compress the seal more. Hold the latch handle in the open position, and slowly close thedoor and feel for interference. this is the up/down adjustment check. Grind off part of the washer if needed, it is just for the oversized hole.
3. Finally is the deadbolt adjustment. The deadbolt must align with the strike plate. This is also a up/down & in/out adjustment. Take out the screws and remove the plate, and use masking tape over the hole. Shut the door and partially lock the deadbolt to make an impression in the tape. this will show you where the plate needs to be. Remount the plate as needed.
Hope this helps.
2014 40QBH Phaeton DP Cummins 380HP ISL, Freightliner XC, 2019 Jeep Grand Cherokee Trailhawk TOAD
Blue Ox Aventa tow bar, SMI Air Force One -Cave Creek, AZ.