Last year wasn't the best year for tech stocks, with many seeing drops into double-digit percentages. Luckily, 2023 has been much better. The tech-heavy Nasdaq Composite -- which tracks almost all stocks on the Nasdaq stock exchange -- is up over 21% year to date.

If you're a long-term investor interested in tech stocks that you can comfortably hold in your portfolio for the next decade, look no further.

1. AT&T

It's been a well-documented regrettable past decade for AT&T (T 1.07%), with the stock down over 40%. After spending over $100 billion to enter the media and entertainment industry, AT&T finally threw in the towel last year, spinning off its WarnerMedia business in a $43 billion deal.

A lot of what has plagued AT&T recently is the large amount of debt it took on with its media and entertainment ambitions. AT&T has had over $100 billion in debt since 2015, which, needless to say, has cost the company a lot in interest. It paid over $6 billion in interest last year alone.

T Chart

DATA BY YCharts

The company is trimming down its business and refocusing on its core telecom business, which should relieve investors. After a cash infusion from its WarnerMedia spinoff, AT&T paid off a good amount of debt, but it has a ways to go. Still, AT&T management's recent steps to actively address debt problems make the stock attractive if you're in it for the long haul.

AT&T's bread and butter is undoubtedly its telecom business, and it seems the company is again treating it as such, though I'm sure investors would've preferred if it didn't take this long to realize it. This refocus is coming at a great time as the industry progresses toward 5G.

In Q1 2023, AT&T added 424,000 postpaid phone customers (11 straight quarters with at least 400,000 added) and 272,000 AT&T Fiber customers (13 straight quarters with at least 200,000 added).

With a price-to-earnings ratio of around 6.8 (the S&P 500's is over 23) and a 6.5% dividend yield, the potential upside for long-term investors far outweighs the potential downside, in my opinion.

2. Apple

As the most valuable public company in the world, it's hard to believe how much more Apple (AAPL 0.73%) can grow, but it's shown time and time again that it will find a way. After losing over a quarter of its value in 2022, it's since changed course, up over 35% year to date.

The iPhone is still Apple's moneymaker, accounting for more than half of its revenue, but its growth will likely depend on how well it can continue to develop and build out its services ecosystem. Its $20.9 billion in services revenue (up over 5.4% year over year) was an all-time high for the company.

What excites me most about Apple's future is its venture into the financial services industry. The signs were always there, beginning with the company's Apple Pay and later with Apple Card. Apple Card was a big step, but Apple used Goldman Sachs to underwrite and fund loans and credit lines.

Apple Pay Later was the first time the company decided to underwrite and fund loans and credit lines by itself -- a pivotal step in making its presence felt in the finance industry. An even bigger step is the high-yield savings account the company launched this year (in partnership with Goldman Sachs), which received close to $1 billion in deposits in its first four days, as reported by Forbes.

Apple's savings account comes at a time when the banking industry -- especially smaller and regional banks -- is going through some public distrust, giving the company a chance to capitalize on its brand and unmatched brand loyalty.

With arguably as good of technical resources available as any company, the rest of the fintech world should be on alert about Apple. Finance is rapidly changing and becoming digital, and who is better equipped to help usher in that change than Apple? It's for sure a buy-and-hold stock over the next decade.