To deter raccoons, secure trash can lids with bungee cords or locks, store trash in sturdy containers with tight-fitting lids, clean trash cans regularly to remove food odors, and avoid leaving pet food outside. Additionally, install motion-activated lights or sprinklers and trim tree branches that provide access to your trash cans.