It was the 1980s, greed was good, and William “Preston” King was on top of the world.

The stockbroker — who was pals with “Wolf of Wall Street” Jordan Belfort — raked in the dough from plum jobs with Merrill Lynch and Oppenheimer & Co., living large in a Soho loft and driving around in a BMW.

But the tall, blue-eyed-and-blond regular at downtown dance clubs partied too hard — sucking down Rémy Martin and Cokes and snorting mountains of cocaine.

The good times turned into a downward spiral that lasted three decades — and led him to a life on the streets, sleeping on empty pizza boxes on a Greenwich Village sidewalk, his family says.

“The kid had everything at his fingertips,” said King’s younger sister, Kristine, who learned of his plight from a photo in Monday’s Post. “Anything he wanted he could have.”

The photo was part of a collection assembled by the NYPD’s sergeants union as part of a campaign to shame City Hall into action against vagrants.

“Where he was then, and where he is now, sleeping on cardboard boxes, it’s unthinkable to me and heartbreaking,” said Kristine King, 45, whose family’s last contact with Preston was in January.

She said her brother, 52, grew up on Long Island, and his dad and grandfather were horse trainers.

He scored in the top 2 percent on the Series 7 stockbrokers exam despite dropping out of high school and NYU, she said. And he taught himself five foreign languages, learning French on his own in three weeks and picking up Dutch on a trip to Amsterdam.

But his demons always won out, eventually destroying his marriage to a single mom with whom he had moved to Florida.

He returned to New York and landed a job with a reality-TV show through his producer sister — but then lost it for showing up to work drunk.

But even all that did little to prepare his family for the shock they got Monday.

Kristine said their mom spotted the photo and immediately called her, leading Kristine to email The Post, which put her in touch with Sergeants Benevolent Association President Ed Mullins.

Hours later, Kristine and SBA Treasurer Paul Capotosto were scouring the Village and handing out fliers to find her brother.

“The sergeants, the SBA and the New York Post are amazing,” she said.

The last his family knew, Preston was getting detoxed at Arms Acres in Putnam County, where he was sent after a January incident at his sister’s house, where he had been living.

Kristine said he had been seeing a shrink who prescribed him Adderall, which Preston abused to the point of paranoia.

She said she cut ties with him for stealing her cash.

“I screamed at him about taking the money and told him to write me a letter and apologize when he comes clean, and we’ll talk,” she said.

“That was the last time we spoke.”

Kristine had a tearful message for her suffering brother.

“I want him to know his sister loves him and wants to get him help and wants to make sure he’s OK,” she said. “I would go to the end of the Earth to protect and save him.”

A friend who worked an overnight shift with Preston last year at a company raising investment money for a tech firm recalled watching “The Wolf of Wall Street,” starring Leonardo DiCaprio, with him on cable TV.

“He’s like, ‘All right, I used to work with these guys,’ ” said Jesse Catlin, 33. “He was giving me all the stories from the glory days.”

Belfort did not return requests for comment.

At a City Hall news conference Monday, Mayor Bill de Blasio downplayed the SBA’s campaign and all but blamed The Post for any rise in complaints about vagrants.

“I don’t think you have to be a social scientist to say if you in the media are talking about it all the time, people may think about it or be more sensitive,” he said.

Additional reporting by Yoav Gonen