Most stocks have dipped in and out of bear territory in recent months. Many investors are understandably discouraged over the state of the market in last year and a half -- the same market that had boomed following the original pandemic downturn three years ago. But the stock market is highly cyclical. In the last hundred years, it has dealt investors many ups and downs. 

However, there has never been a bear market -- nor a prolonged period of volatility -- from which the stock market has not eventually recovered, and outpaced its prior returns to boot. Sometimes, these periods of volatility have lasted for months, or even years. Throughout those periods, great businesses have persisted. 

Here are two such stocks to buy, whether or not the market veers into bull or bear territory in the coming months. 

1. Airbnb 

Airbnb (ABNB 2.77%) continues to make travel accessible to anyone, anywhere, with a platform that offers an incredibly diverse range of stays to service an equally diverse variety of travel needs. While the company is certainly not the only player within the travel industry that provides curated stays and long-term living arrangements, few are operating at the exact scale and boast as wide a spectrum of offerings as Airbnb.

Airbnb's platform benefits from both sides of the travel accommodation segment, all while incurring minimal overhead costs, because it doesn't own the properties listed on its website. Whether you're a digital nomad looking for a property in Bali to live in for months at a time, or a family searching for a vacation home in the Florida Keys, Airbnb probably has what you're looking for. The company is constantly upgrading the travel experience for both hosts and guests, a move that is continuing to drive both in droves to its platform. 

For example, Airbnb recently introduced better pricing transparency tools so that guests can view the total cost of their stay upfront when searching for accommodation, a reduction in fees for guests who are booking stays of longer than three months, and even a new feature that allows guests to look at the checkout instructions for a specific stay before they book. The company is also partnering with popular buy now, pay later brand Klarna so that guests can choose to pay for their stays in installments rather than forking over half, most, or all of the cost of their reservation when they book.  

On the host side, Airbnb just launched an initiative called Host Passport, which allows guests to learn more details about their host before booking with them. Host Passport can feature everything from personal details such as the host's favorite hobbies or food to past reviews from guests and their hosting history. The company also introduced a new tool to make it easier for hosts to price compare their listing to other stays in the area and determine the most effective pricing structure for the accommodation they're renting out.  

But as they say, the proof is in the pudding. Not only were nights and experiences booked up 19% year over year in the first quarter, but active host listings also surged 18%. Long-term stays (which are bookings of 28 days or more) comprised 18% of all bookings in the three-month period, while stays of at least seven nights accounted for 45% of all bookings. Airbnb reported the highest revenue it had ever generated in a first quarter, reaching $1.8 billion on the top line, up 20% from the year-ago period. It also reported its first-ever profitable first quarter and the highest free-cash-flow figure in its company history. Those two numbers came in at $117 million and $1.6 billion, respectively.  

Even as concerns about a recession remain, people are spending money on travel and experiences. The emergence of a new and more flexible kind of traveler given the rise of remote, hybrid, and freelance work is likely also a factor here. If you're looking at a minimum investment period of three to five years, even if a recession hits, Airbnb appears to be a solid bet on the future of travel and even the changing world of work. 

2. Mastercard 

As of one of the largest payment processing companies in the world by revenue, Mastercard (MA 1.33%) can be seen as something of a bellwether to monitor the spending habits of consumers. At the same time, the company's business model offers it a remarkable measure of resilience in both high and low economic tides. This is because Mastercard doesn't make money from lending credit to consumers. 

Instead, Mastercard's revenue and profits are tied to gross dollar volume. Mastercard charges transaction fees to the financial institutions that dispense its products, such as credit or debit cards. The more gross dollar volume that is spent by consumers using its branded products, the more transaction fees Mastercard accumulates from these financial institutions, which flow to its top and bottom lines.

If macro conditions are more constrained and consumers are spending less, while this would affect the gross dollar volume that Mastercard reports, its business wouldn't be on the hook for unpaid consumer loans such as credit card debt. I've made this point before but it's worth mentioning again: In difficult or even recessionary economic times, consumers have a tendency to put more expenses on credit cards, which would still translate into more transaction fees for the business. 

Over the trailing 12 months, Mastercard has pulled in about $23 billion in revenue and $10 billion in net income. It's also accumulated roughly $11 billion in operating cash flow. In the first quarter of 2023, it reported $5.7 billion in total net revenue, a 14% hike on a currency-neutral basis from the year-ago period. Gross dollar volume for the three-month period was up 15% globally and 9% in the U.S. compared to the year-ago quarter.

It's also worth mentioning that this faithful dividend payer, while only yielding about 1% at the time of this writing, has seen its payout rise 130% over the trailing five years. The stock has also delivered a total return of about 100% in that time.

Because Mastercard's business model revolves around transaction volume rather than lending money to consumers, it's coming from a position of strength whether or not the economy veers into a full-blown recession. For long-term buy-and-hold investors, this could be a top financial stock to add to your buy list the next time you go stock shopping.