There are different levels of occasional invader issues. An outlier intrusion of an earwig is a different issue than a stink bug infestation, for example. Earwigs and house crickets can be controlled with perimeter sprays, with a focus on door and window frames.
The brown marmorated stink bug species (Halyomorpha halys) in particular tends to be attracted to siding that catches heat from the sun. Spraying siding and adjacent shrubs will help reduce population levels. Mechanical exclusion is the best method to keep these bugs from entering homes and buildings. Seal cracks around windows, doors, siding, etc. Damaged screens on doors and windows should be repaired or replaced.