Train tracks run through the back yard.
The college kids who live next door litter their yard with beer cans nightly. A major highway is visible from the kitchen window. There's an airport nearby. If a house you've considered buying meets one of those conditions, you either accept the fact that you' re not going to get 10 silent hours of sleep every night, choose a house in another location, or invent a bed with active noise reduction. It's just common sense.