On a muggy morning in July 2008, hundreds of customers stood outside IndyMac Bank branches in Southern California, trying to pull their savings from the lender, which was doomed by losses on risky mortgages.

Steven Mnuchin didn’t know much about IndyMac as he watched the scenes on CNBC from his Midtown Manhattan office. But he immediately saw an opportunity and began figuring out how to buy the bank.

Regulators seized IndyMac, foreshadowing a vicious banking crisis. Six months later, Mr. Mnuchin and his investment partners acquired IndyMac with a helping hand from the U.S. government. The deal eventually earned him hundreds of millions of dollars in personal profits.

The former Goldman Sachs Group Inc. partner, Hollywood financier and hedge-fund manager now is President-elect Donald Trump’s choice for Treasury secretary. Like other Trump cabinet picks, Mr. Mnuchin has a résumé that is at odds with much of the president-elect’s populist rhetoric on the campaign trail.

Mr. Trump is building a cabinet that combines traditional Republican Party leanings with unconventional elements, including people who made their fortunes by taking big investment risks. IndyMac was the defining deal of Mr. Mnuchin’s career. He knew that the government needed to sell the failed bank—and he played hardball.

President-elect Donald Trump turned to former Goldman Sachs banker and movie financier Steven Mnuchin to be the next Treasury secretary. WSJ’s Rick Carew takes a look at his background. Photo: Getty

In an interview Tuesday before word leaked he was Mr. Trump’s choice, Mr. Mnuchin said he is proud of the transformation at IndyMac, based in Pasadena, Calif. “We turned around a huge economic disaster,” he said.

Mr. Mnuchin, 53 years old, has no experience in government or running a large organization, though he was a campaign loyalist and fundraiser for Mr. Trump. Mr. Mnuchin’s political views are a secret even to some of his associates. If confirmed by the Senate, the defining traits he will bring as the 77th Treasury secretary include a Wall Street pedigree, long relationship with Mr. Trump, and a history of moving fast to seize opportunities that might terrify others.

In the interview, Mr. Mnuchin said the new administration’s goal would be to achieve annual economic growth of 3% to 4%. He said his top policy priorities would be to overhaul the federal tax code, roll back certain financial regulations, review trade agreements and invest in infrastructure.

Mr. Mnuchin is regarded within the Trump transition team’s inner circle as a skilled team player. Mr. Trump’s advisers say Mr. Mnuchin will fuse traditional Republican Party support for lower taxes and less regulation with the president-elect’s populist stances on trade and infrastructure.

“Trump, like Ronald Reagan, would go outside of the box,” Mr. Mnuchin said in the interview Tuesday. He said Mr. Trump won’t hesitate to call up corporate chiefs to lean on them about jobs, factory closures and other matters.

The IndyMac deal will likely be a feature of Mr. Mnuchin’s confirmation process. Sen. Ron Wyden, the top Democrat on the Senate committee that will hold hearings on the proposed appointment, said Tuesday that Mr. Mnuchin has a “history of profiting off the victims of predatory lending.”

Foreclosures on the homes of delinquent IndyMac borrowers sparked protests outside Mr. Mnuchin’s mansion in the Bel Air neighborhood of Los Angeles. The bank, which was renamed OneWest Bank and is now part of CIT Group Inc., is under civil investigation by the Department of Housing and Urban Development for loan-servicing practices.

Donald Trump with Steven Mnuchin, right, and his former wife Heather Mnuchin at a New York social event in 2004. Photo: Clint Spaulding/Patrick McMullan Agency

CIT said it is “committed to fair-lending and works hard to meet the credit needs of all communities and neighborhoods we serve.”

Mr. Mnuchin, whose father spent his entire career at Goldman, came of age on Wall Street in the 1980s as the business of slicing loans into securities was booming. As a mortgage banker at Goldman, he saw up close ¾the savings-and-loan crisis and efforts by the government to wind down hundreds of insolvent financial institutions.

Colleagues recall Mr. Mnuchin’s ability to quickly weigh the risks involved in particular trades. He made partner in 1994 and oversaw Goldman’s mortgage-trading desk before becoming chief information officer.

Dinner parties

Like other partners, he earned tens of millions of dollars when Goldman became a publicly traded company in 1999. He bought a 6,500-square-foot apartment in a famous Park Avenue building. Messrs. Mnuchin and Trump were soon in the same philanthropic and social circles, attending dinner parties at each other’s Manhattan homes and mingling at the U.S. Open tennis tournament and the Metropolitan Museum of Art Gala.

The reserved Mr. Mnuchin never struck colleagues as a political animal but contributed regularly to political campaigns, records show.

In the interview, he said he has been a registered Republican for “as long as I can remember,” yet he also gave a total of $7,400 since 2000 to Democrat Hillary Clinton’s campaigns.

Mr. Mnuchin donated to the campaigns of Democrats Barack Obama, John Edwards, John Kerry and Al Gore. The only Republican presidential candidate Mr. Mnuchin gave money to was Mitt Romney in 2012.

In 2002, Mr. Mnuchin left Goldman and wound up running an investment fund set up by billionaire investor George Soros. Mr. Soros was a big contributor to the super PAC backing Mrs. Clinton in her unsuccessful presidential campaign this year and has donated to other groups supporting Democrats.

Mr. Mnuchin and two former Goldman colleagues struck out on their own in 2004 with a new hedge fund, Dune Capital Management LP, which received financial backing from Mr. Soros. Mr. Mnuchin soon steered Dune into the business of financing Hollywood films, which began to elevate his public profile. He also was part of a group that lent money to Mr. Trump for a Chicago condominium project.

When IndyMac unraveled in 2008, the images of customers lined up around corners and across parking lots became an enduring symbol of the financial crisis. Federal Deposit Insurance Corp. officials descended on IndyMac’s headquarters on July 11 and shut down the bank.

Homeowners protested foreclosures by IndyMac at a OneWest office in Pasadena, Calif., in 2009. Photo: AP

It was the second-largest bank failure of the crisis, surpassed only by Washington Mutual Inc. in September 2008.

Federal officials expected to suffer as much as $8 billion in losses from IndyMac. That left regulators looking for someone to take over the bank and mitigate the damage. Speed was essential, since the FDIC was bracing for a wave of additional bank failures.

Mr. Mnuchin assembled an all-star cast drawn from his years on Wall Street, including Mr. Soros, hedge-fund manager John Paulson, billionaire Michael Dell’s investment firm and several former Goldman executives, including J. Christopher Flowers. They signed up on the basis that Mr. Mnuchin would personally run the bank, according to people familiar with the matter.

By now, he knew that few bidders would be willing to buy all the failed bank’s assets. And he knew he was taking a giant risk.

At the end of 2008, Mr. Mnuchin persuaded the FDIC to sell IndyMac for about $1.5 billion. The deal included IndyMac branches, deposits and assets. The FDIC also agreed to protect the buyers from the most severe losses for years. That loss-sharing arrangement turned out to be a master stroke.

Customers waited for an IndyMac Bank branch to open in Pasadena, Calif., in July 2008. Photo: EPA

Mr. Mnuchin threw himself into managing IndyMac, where he became chairman and chief executive of the parent company. He moved from New York to California. To accomplish his goal of a quick turnaround, Mr. Mnuchin needed to deal with IndyMac’s bad mortgages and other assets, a job made easier by the FDIC’s agreement.

Mr. Mnuchin set out to refashion OneWest as a plain-vanilla lender that eschewed the unconventional mortgages that got IndyMac in trouble. It was a major provider of Alt-A loans, a category between prime and subprime that often involved borrowers who didn’t fully document their income or assets.

He began scouting opportunities for OneWest to buy other small lenders. Before long, OneWest had doubled the number of branches that IndyMac had when it failed. OneWest often paid more than other banks for deposits, helping it attract new customers while interest rates were unusually low.

Sharing the losses

Banks often go out of their way to avoid losses, even when borrowers are in violation of loan terms. The loss-sharing agreement took away some of the disincentives, since future losses would be borne partly by the government.

In October 2011, dozens of activists gathered outside his mansion to protest OneWest’s evictions, waving signs and shouting angry slogans. Mr. Mnuchin has said he was rattled, and OneWest agreed to pay for security services at his home.

Mr. Mnuchin said Tuesday it was “unfortunate that anyone was foreclosed, [but] all these loans were originated under previous management.”

In 2013, OneWest had more than $300 million in profits, nearly equal to what IndyMac earned in 2006. It had a loss of $767 million in the first half of 2008.

Mr. Mnuchin’s next step was to sell. He toyed with the idea of taking OneWest public. Then a better option came along. Another Goldman veteran, former Merrill Lynch & Co. Chief Executive John Thain, had taken over commercial lender CIT Group Inc. and was trying to fortify its finances. OneWest was a source of stable deposits.

In July 2014, CIT agreed to buy OneWest for $3.4 billion, a bounty of more than $3 billion, including dividends. Mr. Mnuchin’s take was several hundred million dollars, according to a person familiar with the matter. He stayed on at CIT.

After the sale, newly discovered accounting problems forced CIT to take a $230 million charge.

It inherited another problem from nearly $40 million of loans OneWest made in 2014 to struggling film studio Relativity Media LLC, in which Mr. Mnuchin was a big investor through his Dune Capital hedge fund.

Relativity filed for bankruptcy less than a year later, and CIT struggled to get the loans repaid. A film-financing company that also was owed money by Relativity accused OneWest of getting favorable repayments because of Mr. Mnuchin’s dual roles at the bank and the studio. He declined to comment.

Mr. Mnuchin left CIT amid a management shake-up announced last year, receiving a $10.9 million severance payment. His exit came just as Mr. Trump’s bid for the Republican nomination was gaining momentum. “The timing worked out well,” Mr. Mnuchin told The Wall Street Journal earlier this year.

Before formally launching his presidential bid, Mr. Trump turned to Mr. Mnuchin for advice over dinner. Mr. Mnuchin helped write a tax-cutting plan and tried to rein in some of Mr. Trump’s populist rhetoric, including his vow to not “let Wall street get away with murder,” people familiar with the matter said.

“I don’t think he has negative views on Wall Street,” Mr. Mnuchin said of Mr. Trump in the earlier interview.

When Mr. Trump delivered his victory speech after the New York primary in April, Mr. Mnuchin stood behind him and took photos of the crowd with his cellphone. The next morning, Mr. Trump asked if he would consider taking the role of national finance chairman, an operation that had previously relied largely on Mr. Trump’s own bank account. Mr. Mnuchin agreed.

Mr. Mnuchin had no previous experience in political fundraising and the finance operation endured early setbacks. It eventually got on track.

Mr. Mnuchin, who divorced his second wife in 2014, brought his fiancée, Scottish actress Louise Linton, on the Trump campaign plane, where she got to see a draft of one of his foreign-policy speeches, she wrote in an Instagram post.

Since Election Night, Mr. Mnuchin has been commuting from Los Angeles to New York and has been a regular presence inside Trump Tower as the president-elect works on the transition team.

Mr. Trump’s financial agenda, which Mr. Mnuchin would lead as Treasury secretary, has ignited a broad stock-market rally. CIT shares are up about 13%, increasing the value of Mr. Mnuchin’s stake by about $11 million. It is now worth more than $100 million.

—Nick Timiraos and Damian Paletta contributed to this article.

Write to Rachel Louise Ensign at rachel.ensign@wsj.com, Anupreeta Das at anupreeta.das@wsj.com and Rebecca Ballhaus at Rebecca.Ballhaus@wsj.com