I was lucky back when I was a homeowner in that I had quiet neighbors.
But I had a close call when I first moved in. My next door neighbor at the time turned out to be the entrepreneurial type who was also a "mail order minister" (until the IRS shut down the "Church of Life"). He was open about remodeling his back yard to hold wedding receptions, but the business would have been illegal due to zoning, so he befriended all of us so we wouldn't complain. Luckily, the authorities shut him down for other reasons and he moved on. However, I had contingency plans in place to report him if it ever came to that.
After he moved away, my neighbors told me the person who sold me the house was worried this guy would scare me off and had the mail order minister scale back his activities until after I moved in. In today's world, my seller would have had to disclose this potential issue in the selling documents, but he was probably within the limits of the law at the time (the 1980s).
I wasn't so lucky when I first moved into my present apartment.
The building had quiet hours written into the lease. But one of my neighbors was loud at times, both before and after quiet hours were in effect. I was advised to work with the neighbor, but his response was that since he wasn't trying to upset me, it wasn't my problem if his noise upset me. The apartment manager (who didn't live there) needed independent third-party verification before taking action. I finally got it after about a year (the apartment had a "three strikes" policy and it took me awhile to get the strike count I needed to get rid of him). My neighbor would lay low for a time after being warned and would then slowly increase his noise again. I used protective ear plugs and ear muffs during this year, along with making contingency plans about moving if the situation didn't get resolved.
My takeaways from my experiences are to be persistent and learn the rules of the system. Noise problems are symptomatic of larger issues. Municipalities have ordinances on the books, but getting them enforced can be a challenge because code enforcement people are understaffed and the police have strict rules they have to follow when responding to complaints. Sometimes the persistence has to rise to the level of becoming a community reform leader (New Worry for Home Buyers: A Party House Next Door), but the end outcome can be positive.
In my case, a carpet was installed after my noisy neighbor moved out, which provided half the solution, and subsequent neighbors were reminded about the quiet hours at the time they signed the lease, which provided the other half (these people also had the attitude of wanting to get along with their neighbors and kept their noise down as a result). I'm keeping my fingers crossed, but I've never had to use the ear plugs since.