This month is a milestone New York-versary for me: I will have lived in the Big Apple for two decades. It’s easy to construct a rational narrative of how I got here and conclude that I had a plan. In reality, it has been one random thing after another, and it would be equally fair to characterize it as a miracle or a still-impending disaster.

History is always on the periphery of our lives, and what ­reminded me of this marker was stories about the 20th anniversary of JFK, Jr.’s death in a plane crash. I was packing up my 10 boxes of belongings in the sweltering heat of New Orleans to ship them to the more sweltering heat of Brooklyn when I learned that JFK, Jr., his wife, and sister-in-law were missing.

What seemed a national tragedy unfolded as I left my $237.50-a-month apartment for the last time. Today, it seems more a tragedy limited to two private families, another affable young man who couldn’t assess the risk of his own behavior.

I had thought only vaguely about how I was going make money when I got to New York. I liked to write, and because I had worked at a southern investment bank while in college, I knew (or pretended to know) a little about finance.

I answered advertisements in the Sunday Times classified that appeared to combine writing and finance and went to two job interviews. One was for a job at Risk Waters, a financial-tech publishing firm; the other was writing about global debt at Thomson (now ThomsonReuters).

I took the second, partly because debt seemed more interesting than tech. Two years later, the lovely man who interviewed me at Risk Waters would be dead, along with 15 of his colleagues, atop Windows on the World.

Until then, millennial New York was one big party for people of a certain age in a certain place in life. It is hard to recreate, for people who weren’t there, what it was like to be dropped into the summer of 1999 New York, part of the generation that had been singing along to Prince since kindergarten, amid a stock-market boom that seemed to include everybody (although it didn’t).

My employer’s main worry was that someone might quit; whenever someone flickered a hint of unhappiness, everyone got raises. My summer 2000 memory was of sitting on the floor of my then-boyfriend’s, now-husband’s, office on the 79th floor of One World Trade Center after dinner in SoHo, staring out the slats down at the Tall Ships.

9/11 hasn’t cast a shadow over 18 of my 20 years, but it did cast a something. My Thomson office was across the street from the old WTC, and Thomson lost several people who either worked in or were visiting the WTC. Today, what is striking is how young they were; the rest of us have moved sadly far away from them in time, grappling with our stray gray hairs and the choices — marriage or no? kids or no? — that they didn’t get to make.

We came back to work just after Halloween 2001 to our stripped offices and watched steelworkers torch down what was left of the old buildings, white-hot flares brighter as the days grew shorter.

9/11 is, now, history. Despite tortured government efforts to remake the skyline, the building most prominent now isn’t 1WTC, but the spare rectangle of the 432 Park Avenue residential tower.

My first 10 years in New York were defined by a local-government fear that New York wouldn’t grow, despite all evidence. Millennial-fever New York was more surprised at its resurgence than planning to accommodate it. People older than me were shocked that I might take the subway past 10 p.m. and not be robbed, raped and murdered.

The last 10 years have been ­defined by a failure to plan for the growth that came, anyway. New York’s post-millennial problem is success: record numbers of everything — and no modern infrastructure to fit it all. Now, everyone is shocked, at 10 p.m., to find a seat on the subway.

Despite that, most of the time, New York, and life, are a gift. New York is watching the airplanes cross Citi Field in summer as the Mets almost win, sitting and reading on the grass at Lincoln Center, skating every morning in winter for exercise at Rockefeller Center before the tourists descend, making friends (and frenemies) in unexpected places, having a small voice in the direction of the city.

Twenty years is a long time. In 1999, I had three healthy grandparents; today, I have none. In 1999, I was part of my family’s youngest generation; today I have two nephews who are no longer toddlers. I’ve lived in my apartment for nearly 18 years, longer than I’ve lived anywhere.

But 20 years isn’t enough to be complacent in New York: I still worry that I won’t be able to make rent. The secret to Gotham life is stone-cold fearlessness alternating with stone-cold terror of failure.

Nicole Gelinas is a contributing editor of City Journal.