The formula for growing your wealth by investing in equities looks extremely simple on the surface. The first step is to buy quality stocks that can perform well over the long run. The second step is to wait for your holdings to compound your initial investment. Buy and wait; easy enough. However, there are caveats to this strategy. Here's an important one: It's not always easy to determine which stocks to buy, and the wrong choice could lead to substantial losses.

Some investors are particularly wary of corporations that have led to significant investing losses in recent years. Consider the following two stocks: fintech specialist Block (XYZ 0.71%) and online freelance marketplace Fiverr International (FVRR -1.80%). Both companies have lagged the market by some margin in the past three years, but is that reason enough to avoid them? No, it isn't. In fact, both look like solid picks for long-term investors. Let me explain.

1. Block

Block is best known for two core businesses. The first is Square (the company's former name), which helps small and medium-size businesses in various ways. Square offers slick and convenient point-of-sale systems, inventory management services, payroll, and more. The second arm of Block's business revolves around Cash App, its peer-to-peer (P2P) payment app that competes with traditional banks by offering a debit card, a savings account, direct deposits, stock and cryptocurrency trading, tax preparation services, and so on.

Though these two ecosystems are generally strong, Block faced several hurdles over the past few years. For instance, crypto-related revenue dropped significantly. Also, Block was the subject of a short-seller report that sank its share price. These issues aside, though, its financial results remain strong. In the first quarter, the company's revenue of $5.96 billion increased by 19% year over year. Block's gross profit came in at $2.09 billion, 22% higher than the year-ago period, and both Square and Cash app recorded strong gross profit growth.

Block's net income of $472 million skyrocketed from the $98 million reported in the year-ago period. Block isn't consistently profitable yet, but it has posted a profit in three out of the last five quarters. Even if revenue isn't increasing as fast as it used to -- and very few companies can maintain the growth rates they had in their early days -- there is something to be said about profitable growth. Block is making steady progress in that area.

That should excite investors, especially because there are ample opportunities ahead for the company. Block has routinely added new services to its ecosystem. For instance, it has made Cash App more attractive by granting buy now, pay later capabilities to its customers. Block is arguably building a network effect. The more people use Cash app, the more attractive it becomes as a P2P payment option. And once they enter the company's ecosystem, customers are likely to opt for more of its services.

And that's before we mention the fact that digital methods of payment will only become more popular. In short, Block is a great stock pick to profit from the booming fintech industry.

2. Fiverr International

The gig economy is here to stay. People enjoy working on a freelance basis for a variety of reasons. For some, it's the convenience and flexibility it offers. Nothing beats making money while traveling the world because you aren't tied to a specific office. For others, it's a way to make some money on the side. Whatever the reason, Fiverr helps freelancers market their services and find clients through its platform. Conversely, businesses can quickly onboard freelancers to complete various projects.

Fiverr benefits all those involved. The business was very popular in the early days of the pandemic, but it has since lost some steam, which is why shares have underperformed. In the first quarter, Fiverr's revenue of $93.5 million was up by about 6% year over year -- much lower growth than it used to record a few years ago.

FVRR Revenue (Quarterly YoY Growth) Chart

FVRR Revenue (Quarterly YoY Growth) data by YCharts

Still, there are things Fiverr is doing right. For instance, recent cost-cutting initiatives are bearing fruit. The company's decision to get its expenses in check has led to it becoming profitable. Its net earnings per share in the first quarter came in at $0.02, compared to a loss per share of $0.11 in the year-ago period.

What's next for Fiverr? One exciting area for Fiverr is artificial intelligence (AI). According to management, the demand for AI-related services on its platform is positively impacting its top line. During the first quarter, the company reported 95% year-over-year growth in AI-related gross merchandise volume.

Whether it's in AI or elsewhere, though, Fiverr will continue benefiting as the gig economy grows, and that won't stop anytime soon, according to forecasts from Business Research Insights. That's why the stock could deliver solid returns and help make investors richer.