Carrie Bradshaw’s apartment really did a number on us all, with the pie-in-the-sky vision of a writer living in a safe, quiet neighborhood for only $700 a month. That’s truly affordable housing. But, real-life New York is much more about dreams. For example, the writer who invented Carrie, Candace Bushnell, sold her Greenwich Village one-bedroom last year for more than $2 million, or over $2,000 a square foot.

However, if you’re determined to make it here, it’s worth a try to get some affordable housing — which is generally defined as keeping your housing expenses at less than 30 percent of your income. The city is an octopus of programs in this regard, but here are some ideas to help you get started.

NYC Housing Connect

NYC Housing Connect is a portal set up by the city to provide access to affordable housing programs. Like many cool internet resources, it can get jammed up by demand, so if the portal isn’t responding, check back another time. Current listings include lotteries for 10 different developments with affordable rentals, with amenities ranging from in-unit washer-dryers, to a landscaped terrace, to bike parking, to an art studio.

Who Would Benefit: All renters. Many programs give preference to city employees and to people with certain disabilities, so if you’re in one of those categories scamper over to Housing Connect post-haste. You can apply for these lotteries online or via snail mail — but don’t do both, because if the city finds multiple applications for a program, they’ll disqualify you.

City-Subsidized Rental Opportunities

City-Subsidized Rental Opportunities is run by the City’s Department of Housing Preservation and Development. HPD is a 38-year-old agency that works with private developers to maximize government subsidies to help create and maintain affordable housing.

You’ll find links to some developments that aren’t listed in Housing Connect, even though our research found some of those lotteries to have closed months ago.

Who Would Benefit: All renters. Be aware that some developments give preference to people who are already residents of the local area (as defined by the Community Board), so if you’ve really got your heart set on affordable housing in, say, East Harlem, you might up your chances by moving to East Harlem — even if you start in unaffordable housing.

First-Home Club

First-Home Club is a banking program that matches the savings of potential first-time home buyers — granting $4 for every $1 saved, up to $7,500 in matching funds. It’s for home buyers at or below 80 percent of the area’s median income (AMI). Data geeks take note: the AMI is not a city-generated number; it’s instead calculated by the U.S. Department of Housing and Urban Development. The 2015 AMI for New York City was $81,600 for a three-person family, so three-person families with incomes of $61,600 or lower would be eligible for this program. (As you’d expect, AMI goes down for smaller families and up for larger ones).

Who Would Benefit: Potential homeowners with lower incomes, and divorcees. (Single parents can be considered “first-time home buyers” even if they previously owned a principal residence with a former spouse.) See program guidelines for First Home Club.

Mitchell-Lama Housing

Mitchell-Lama was set up in the middle of the last century to subsidize middle-class housing, and, although buildings keep exiting the program there are still tens of thousands of units in both rental and co-op buildings in New York. Demand is even greater than that, however, so you’ll want to identify target buildings and get your name on their waiting lists.

Who Would Benefit: All potential home buyers, especially veterans (who can jump to the top of existing waiting lists) and the Bronx-bound (the current roundup of developments with short waiting lists includes several buildings in The Bronx, both co-ops and rentals.)

Affordable Co-operative Housing Program

Affordable Co-operative Housing Program was the mechanism by which New York City’s Housing Development Corporation, a financing agency, helped developers build middle-income housing for renters and owners. Harlemites will recognize many buildings helped by the program, including Embelesar 118, the Sutton, and the Bradhurst. As units in those buildings turn over, new potential residents face income restrictions — but those income caps can be fairly high, in the six figures. Here’s an example of a restricted sale in which the broker mentions the purchaser’s income has to be under $142,395.

Who Would Benefit: All potential purchasers. Freelancers might have an edge, since the measurement of “income” for a freelancer is net income after business expenses, not gross income, which is the measurement of income for a salaried person. Be aware that each building has slightly different rules, and if you are looking at an income-restricted apartment, you might also have to meet a test that your assets are below a certain amount — and it’s tough to have your cake and eat it too. These units are meant to be primary residences, and if you own a pre-existing apartment, an imputed rent on that property could be calculated and added to your income.

The Grinnell

The Grinnell (aka “The Dakota of the North”)

Housing Development Finance Corporation

Housing Development Finance Corporation co-operatives are shareholder-run affordable housing buildings, created under a housing law that left a giant loophole: Potential purchasers do not need to meet an asset test. As a result, many of these units have become very expensive in recent years, and often sell in all-cash deals to purchasers who still must meet income restrictions. An analysis by Josh Barbanel of the Wall Street Journal showed more than 220 sales at prices over $500,000 in recent years, including a sale at the Grinnell at 800 Riverside Drive for $2 million. The apartment, a massive three-bedroom, may still have been a deal compared to fully market-rate properties. Mom and dad, can I have a few hundred thousand bucks?

Who Would Benefit: People in nonprofit jobs with rich uncles.