Summer is just around the corner, which often triggers a stock market slump. While sluggishly performing stocks could convince you it's time to sell, keeping a long-term perspective during the warmer months is crucial. The market often rebounds once the air turns chilly, and you won't want to miss out on potential gains.

In the meantime, it's a good idea to strengthen your portfolio by investing in companies with a history of growth. Companies like Apple (AAPL 1.27%) and Costco (COST 0.17%) have provided investors with consistent gains for years and have excellent outlooks for 2023.

These are two of the best hot stocks to buy in June.

1. Apple 

Apple stock hit an all-time high on June 5 ahead of its Worldwide Developers Conference, thanks to anticipation for the debut of its first augmented reality (AR) headset, which it calls the Vision Pro. The company's shares gained 2% in the early hours of the day, hitting a record $184.90 by midday. The stock lost steam later in the day, falling to $179 a share after Apple announced the headset's eye-watering price of $3,499.

However, the downturn doesn't dampen the company's massive potential in AR. Apple shares didn't tumble because its headset lacked innovation, merely because its price doesn't allow it to appeal to the mass market just yet. As a result, an investment in Apple now is not for the success of the current Vision Pro, but for what's possible three or four generations down the line when the price is naturally reduced, making the technology more available to the average consumer. 

Data from Market Research Future reveals the AR market is projected to expand at a compound annual growth rate of 42% through 2030. Meanwhile, Apple's new headset is unlike anything else available, with its advanced capabilities potentially propelling it to the top of the industry. The company has much to gain as the sector develops. 

Apple's Vision Pro looks to be just the beginning of where AR is headed, with now an excellent time to consider buying this hot stock. 

2. Costco

As grocery retailers go, Costco is one of the most reliable investment options available. The company's stock has climbed 160% in the last five years. Meanwhile, its annual revenue and operating income have risen over 60% in the same period.

The wholesale retailer's unique strategy of selling bulk items at low prices to consumers who are paying an annual membership fee for the privilege has won over shoppers worldwide. In fact, the company's membership renewal rate hit 93% in the U.S. and Canada and 90% internationally in 2022.

Costco currently operates in 14 countries, granting it significant growth opportunities. In France alone, the company has opened two stores since 2017. Its success in the country has led to plans to open 15 additional locations by 2025. With similar potential in many other countries, Costco shares will likely continue climbing for years. 

Moreover, easing inflation suggests it's not a bad idea to add a retail stock to your list of holdings. Companies in the industry have the most to gain from the improving cost of living, with now an excellent time to invest before it's too late. Costco is one of the best options, thanks to its past gains in the stock market, compared to peers. The chart below illustrates how Costco's stock growth over the last five years is between double and triple the growth of its biggest competitors. 

COST Chart
Data by YCharts.

As Costco continues to expand its global presence and other areas of its business, like its e-commerce division, the company has much to offer investors. Alongside a dividend that has increased for 19 consecutive years, Costco stock is a no-brainer buy this June.