We make our friends; we make our enemies; but God makes our next-door neighbor.
-G. K. Chesterton

As an electric guitar player, I confess I have in the past been a noisy neighbor. But the sometimes-inconsiderate nature of youth is tempered by age, and I’ve found myself more careful about the volume levels I inflict on my neighbors.

The universe, however, will have its little joke. In a sort of karmic payback, I’ve had to contend with neighbors even more noisy than I was back in the day. Cars roll through the neighborhood equipped with concert-hall-sized sound systems pounding out bass-heavy "music" that rattles the windows. And my neighbors recently decided to practice wooden clog dancing on their cement patio at midnight.

So the question arises: What is the legal (and neighborly) way to deal with rowdy neighbors whose noise leaves you sleep-deprived and exhausted? Nolo, an online resource for answers to common legal questions, offers some guidelines.

Related: 6 Things Not to Do When You’re Sleep-Deprived

The first thing to realize is that you have some recourse: If the noise pollution is chronic, your neighbors may well be breaking the law.

Almost every neighborhood has ordinances prohibiting unreasonable noise levels, and the police will enforce these laws, according to Nolo. To find your municipality's noise rules, look up the local ordinances on your city’s web page.

Then what? You might get used to the noise, but more likely, if you don't say something, you'll reach the end of your rope and call the cops. Instead, take a few deep breaths and approach the neighbors with respect. It’s possible they're unaware how loud they are or that their dog barks while they’re away.

You might bring over some muffins, engage in some friendly chitchat and then say something like, “You know, I’ve been meaning to bring this up. The kids have to get to sleep early because they get up at six for school, and I’m wondering if you could turn down your music after nine. I would really appreciate it.” If they’re reasonable, that might solve the problem right then and there.

The ABCs of nuisance noise

But if you’ve tried that — or your neighbors seem intimidating and you’d rather stay anonymous — try involving the law. Here are some questions to ask yourself.

Is the noise occurring during “quiet times”? Okay, I can stand my neighbor’s midnight clog dancing for at least one night. But if it became a regular ritual, that would be another matter. In terms of the law, the timing of the noise pollution is all important. The loud hammering coming from next door might be perfectly acceptable at 9 a.m., but not at 6 a.m. or midnight. Find out your community’s quiet times, and keep a log for a week or so of the hours the nuisance noise occurs.

Is the noise violating a decibel noise limit? Many residential communities have a decibel limit and prohibit sustained noise above that level, according to Nolo. To measure the nuisance noise, you’ll need an inexpensive decibel level meter or app. Look for them at electronics stores or online.

Related: Listen Up! These Apps Can Help Prevent Noise-Induced Hearing Loss

Is your neighbor ignoring your request to turn down the volume? Nolo experts suggest sending a copy of your local noise ordinance with a note repeating your request. Point out that you'll regretfully need to notify the authorities if you don't get results.

Is your neighbor open to mediation? If you want to keep on good terms with your neighbor, consider giving mediation a try. You could sit down with your neighbor and an impartial mediator and try to resolve your own problems. Mediation services are available in most cities, according to Nolo, and often they are free.

Getting help from the law

If you call the authorities, make sure you have detailed information about the problem with dates and times. If the problem is a barking dog, start by calling Animal Control. Otherwise, try to get the police to arrive while the noise is happening so they can hear it for themselves and measure it.

First, however, ask your other neighbors if they’re bothered by the noise. Nolo points out that some cities won't take action until the noise affects two or more persons, a measure to prevent complaints from excessively sensitive people.

Related: Is Your Attitude Hurting Your Health?

Luke James is a freelance writer and musician who writes about music, soccer, kids, pets and life with his family in northern California.