You're in luck: you can! It's called buying a single-family detached home.
Source: Bought a house before, neighbors moved in with 4 kids who ran around screaming loudly and ignored that my yard wasn't theirs to play in. They also had 2 rather large labs that barked loudly day and night. Working from home with that sort of constant noise pollution is super irritating.