In 1998, when Gillian Anderson posed for the cover of the now-defunct feminist magazine Jane, she had already been voted the “world’s sexiest woman” by the readers of FHM magazine. She had also recently won a Golden Globe and two Screen Actors Guild Awards for her role as FBI special agent Dr. Dana Scully on “The X-Files.”

But on the day of the shoot, all she could think about was how fat she felt.

“So much of my youth, at a time when I could have — should have — been as happy as you can imagine,” was spent obsessing over perceived flaws, she said in a recent interview.

“I know from experience that when one is locked in shame, it’s very difficult to experience pleasure,” she added. “There’s no crack in the door for it to come through.”

Now, after decades of working through her own self-loathing, Anderson, 56, said she wants to help spare others from the pressure to conform to cultural expectations around the way a woman looks, thinks and behaves. Particularly as it relates to sex.

Because even if you’re the actual sexiest person in the world, you can feel entirely unsexy if you’re self-conscious or full of shame, she said. Beyond that, she has come to believe that the discomfort many women have with their bodies and desires is holding them back — in the bedroom and in life.

Over the past few years, Anderson has taken on a handful of side projects focused on women’s pleasure, including publishing a new book, “Want: Sexual Fantasies by Anonymous,” out now. The book is meant to help women feel more comfortable expressing their most intimate desires and embracing what feels good.

“We think of pleasure as being frivolous,” she said. But “what is the point of this complex, torturous existence that we find ourselves in as human beings if there can’t be an element of joy and pleasure?”

For fans of the widely praised Netflix dramedy series “Sex Education,” which ended last fall, Anderson’s sex-first approach to well-being will most likely feel familiar.

On the award-winning series, Anderson plays Dr. Jean Milburn, a sex therapist and mother to a teenage son in the Welsh countryside. Her character begins the series as something of a caricature. But by the end, she proves to be a relatable, perimenopausal single mother to a new infant, struggling to connect with her own sexuality and desires in the haze of postpartum depression.

“The whole ethos behind Jean as a character is that there are no questions too strange or no fantasies too odd,” said Ben Taylor, who directed much of the first two seasons.

When it came time to gather women’s anonymous fantasies for the book, Anderson’s relationship with her 3.3 million followers — cultivated through years of intimate straight-to-camera videos — was crucial. The project was initially named “Dear Gillian,” and her calls for submissions felt personal.

“I’m curating a book of your anonymous letters to me,” she said in one appeal on Instagram. “Wherever you come from, whether you’re 18 or 80, you sleep with men or women or nonbinary individuals or all or no one at all, I want to know your most personal desires. Let’s open up this conversation together, and create something revelatory.”

The book was conceived a few seasons into “Sex Education,” after publishers had been clamoring for her to write about sex. She didn’t feel equipped to write a how-to guide, or a book-length exploration of the vulva, as one publisher suggested. But when her literary agent, Claire Conrad, suggested curating a collection of anonymous sexual fantasies, she became intrigued.

To prepare for her role as Dr. Milburn, Anderson had skimmed the 1973 bestseller “My Secret Garden,” in which Nancy Friday, a journalist, gathered women’s anonymous sexual fantasies at a time when it was taboo to acknowledge that women fantasized about anyone other than their husbands.

In 2022, Conrad proposed compiling a contemporary version of the book, and Anderson was sold — it was a book she herself felt excited to read. “Somehow we sort of, together, cracked up this idea of what happens if you just did that again — how would things have changed?” Conrad said.

In a departure from “My Secret Garden,” most of the fantasies in “Want” are from women who identify as bisexual or pansexual (Anderson herself has dated both women and men). They represent a range of life circumstances, religions and income levels. Fantasies are grouped by theme in chapters with titles such as “Off Limits,” “Rough and Ready,” “Strangers” and “Kink.”

Many of the submissions expressed the same feelings of ambivalence women had conveyed to Friday half a century earlier. Then and now, women wrote of feeling embarrassed by their perceived physical imperfections, or feeling guilty about their sexual appetite or desires, particularly when they involved anything beyond heterosexual sex within marriage. They wrote of “their fear or reluctance to talk to a partner about what they truly think about when they are having sex with them or, often, when masturbating alone,” Anderson writes.

In the book, Anderson suggests that she is figuring out what she wants alongside the reader. “If I’m honest, I think there are two sides to me, as perhaps there are to many women: the side that is good at asking for what I want and the side that will concede to my partner’s desires, that is happy to share my innermost urges, but only if my partner starts the conversation (and then not all of them),” she writes in the introduction. “Is that due to shame? Or an indication that I wouldn’t trust anyone with that level of intimacy? Or is it that I think it’s somehow better to be, in part, unknowable?”