The tech sector had a difficult year in 2022, as soaring inflation followed by rapidly rising interest rates brought the sector back down from the meteoric valuations it saw in 2021.

But there is optimism in the air, with inflation seemingly slowing and many investors expecting the Federal Reserve's aggressive rate-hiking campaign to wind down soon as well. The outlook for this year is still quite uncertain, with liquidity tightening and the impact of all of the Fed's rate hikes still largely unknown.

But if the tech sector is able to bounce back, investors won't want to miss out. A great way to get exposure to a broad sector is through an exchange-traded fund (ETF), which trades like a stock but is composed of a basket of equities, offering more diversification. Here are two good ETFs to help capture the tech sector's rebound.

1. Invesco QQQ Trust

The Invesco QQQ Trust (QQQ -2.07%) is a popular tech ETF because it owns many headline-grabbing tech stocks like Apple, Microsoft, Amazon, Alphabet, and Meta Platforms, just to name some of its largest holdings. Apple and Microsoft alone make up more than 21% of the ETF's assets.

Like the Nasdaq Composite, the QQQ saw its price fall about 33% last year, which isn't so great for an ETF that's supposed to be less risky. But over the last five years, the QQQ is up more than 67%, and since its launch in 1999 the ETF is up more than 426%. So by and large, this has still been a great investment. Of course, the low expense ratio of 0.2% doesn't hurt, either.

Furthermore, investors can take some solace in the fact that these are well-established companies with strong balance sheets and the ability to weather a recession. Both Apple and Microsoft have $23 billion or more of cash and cash equivalents on their balance sheets, and both also made tens of billions of dollars in profits in 2022, despite their struggles.

2. VanEck Semiconductor ETF

As its name suggests, the VanEck Semiconductor ETF (SMH -4.51%) is a good way for investors to get exposure to the burgeoning semiconductor industry, which is responsible for making the chips that power a host of electronics used daily in everything from mobile phones to cars. This ETF is down 25% over the last year, but up almost 111% over the last five. This ETF charges somewhat higher expense fees than the Invesco QQQ Trust, but VanEck's Semiconductor ETF's expense ratio is still fairly reasonable at 0.35%.

The largest holdings in this ETF are Taiwan Semiconductor Manufacturing, Nvidia, ASML Holding NV, and Qualcomm. Taiwan Semiconductor and Nvidia make up about 24%.

Now, concerns about global chip demand are weighing on the industry. Taiwan Semiconductor recently said that it expects revenue in the first quarter to drop 5%, and that it's planning to cut investment in its operations this year due to lower demand.

But semiconductor production can be a very high-margin business in good times, and the chip industry is only expected to grow. The consulting firm McKinsey thinks it could grow 6% to 8% annually and become a $1 trillion industry by 2030. So this ETF should perform well long-term, especially once global demand improves.