Where I live it is completely legal to shoot trespassers, so that would be my option since I live about 30/40 miles from any police station it would take them way too long to respond and by that time the trespasser could run, or assault me and I would be in the right for shooting them.

Where you live it may be different, you may not be able to shoot them due to state laws or you don't have a gun. So call the police. Even if they don't catch the guy they can at least scare him from coming back.

What do you mean - in the front yard or backyard? - well it doesn't necessarily matter as both is trespassing on private land - what you have the options of sneaking a peek at the person of interest through the window to give to the police .alternatively you could ask the neighbours to keep a lookout for the trespasser.you also have the option of installing hidden cameras in and around your home - before the matter gets out of hand. More options are to get some security dogs 🐕🐶🐩 or even seriously consider hiring a security guard company to covertly look after your place.