Grudges can be good. They are one habit that humans have evolved to keep ourselves from the pain of breakups and also from eating mozzarella sticks for every meal.

Illustration by Tracy Ma/The New York Times; Shutterstock

Have you ever held a grudge for years? (Unrelated but are you a Scorpio by any chance?) Grudges can be good, actually, and we should hold onto some of them, like petty Tomagatchis in our emotional pocket. We don't often associate the holding of grudges with virtuous people, but 2019 is a new year, new you.

Sophie Hannah, who wrote "How to Hold a Grudge," published Jan. 1, loves them. So much so that she holds each of her grudges in a special place, in her "grudge cabinet," where she visits them and tends to them.

A prolific crime novelist, Ms. Hannah, who is not a psychologist, used her personal experience — and lots of therapy over the years in which she discussed her grudges in detail — to write this book.

Here is her system of enlightened grudge keeping to process your pettiness.

Ms. Hannah isn't generally in the habit of redefining words that are in the dictionary. "But there's no dictionary definition I can find that doesn't describe a grudge as a negative feeling, or a collection of negative feelings," she said.

The crucial difference in the way Ms. Hannah views grudges is that she believes a grudge is not a feeling. Rather, it's a story that one can learn and benefit from. "When there's some kind of suboptimal thing that somebody has done to us, the grudge is our story that we remember about that incident, because it benefits you to have that story remembered."

Having a grudge-holding system is a little reminder that pops up in our brain as a warning. Say you have a friend named Fred. Fred gets very drunk and is a mess. If you hold a grudge against sloppy Fred because he has been a messy drunk in your house, you don't have to stop being friends with sloppy Fred. You can, however, acknowledge your grudge: Protect yourself and meet him at a bar instead.

Sweeping bad behavior under the rug and pretending it didn't happen will only expose you to more of the same. A lively grudge can both console and validate — it can create space for you to acknowledge that something bad happened to you, and that it matters.

"We are justice-seeking creatures," Ms. Hannah said. Grudges serve as a monument erected to honor the memory of the injustice you suffered. "We're constantly getting messages that our mistreatment doesn't matter," she said. If you don't let things bother you, you're robbing yourself of the opportunity to process negative emotions.

Now that we've established that grudges can be good in your self-preservation, how will you know if you're a person who can have some grudges? If you're a person who analyzes behavior in order to construct a narrative to explain and compartmentalize it, you're likely to be a successful grudge holder.

Those who are detail oriented, too, are likely to excel at grudges. "Whereas, if you barely notice anything that goes on around you, then you're going to accumulate fewer grudges," Ms. Hannah said.

The act of writing down a grudge — or "constructing a grudge story," as Ms. Hannah calls it — provides space to analyze what happened. Perspective gained by the writing and grading process helps to make negative feelings more manageable. "We're getting it out of ourselves so we're not stuck in a feeling," Ms. Hannah said.

She developed a grading system: The 10 Tenets of the Grudge-fold Path. This is meant to guide you as you develop your grudge, serving to help you process the feelings spurred by the offending incident and to put it into perspective, since all grudges are not equal.

The grading system asks questions about the intention of the person who wronged you (definitely bad, possibly bad, not bad); the nature of the situation (very serious, somewhat serious, not very serious); if you were harmed seriously (yes, maybe, no). So, how petty are you? Find out! Try it! It's fun.

Part of the process also involves turning your grudges into artifacts and having a place where you can store them. "The more concrete they are, the more they will protect and inspire you," Ms. Hannah said.

Here, she suggests stepping away from the grudge — physically putting it into your cabinet (which, in our modern era, may be a Google Docs folder) — for at least a day. Then read it over and ask yourself if there's space to bring humor or fun to the story.

Check in: "If I could rewrite this story changing only my behavior, what would I change?" Compare the two versions and ask if the negative feelings you're experiencing result from frustration about not being able to change the past, or anger because you wish you had acted differently. This exercise is designed to let you process negative feelings so that they don't eat away at you until the end of days.

Like a set of resolutions or goals, grudge stories can be motivating. They can inspire us by defining values that are important to us; if, for example, someone is very rude and you form a grudge about that behavior, it may inspire you to be more courteous.

Grudges can also encourage you to be more forgiving. Validating — even welcoming! — negative feelings by acknowledging that they have a right to be there is a way to keep the negativity from calcifying.

Constructing a grudge also gives us agency. Instead of feeling like you're a person to whom things happen and are done, you may become an active participant in the situation. But your grudges, Ms. Hannah warns, should be held responsibly. By constructing your grudge, classifying and grading it, you should feel more empowered, and not feel like a victim.

Happy grudging!