Index funds can be a low-cost, low-risk way for investors, especially first-timers, to get into the market. But what exactly are they?

You can think of an index fund as a basket of stocks with hundreds or thousands of different ones inside, explains Nick Holeman, a certified financial planner at Betterment. The S&P 500, for example, is a fund that holds stocks for the 500 largest companies in the U.S., which includes familiar names such as Apple, Google, Exxon and Johnson & Johnson.

"It's the cheapest and easiest way to diversify your money that you're investing," Holeman says.

Think of it this way: If every individual stock were a Lego brick, buying an index would be like getting a set of Legos that includes one of every color, explains Andy Smith, a CFP at Financial Engines.

"Instead of saying, 'I want this piece and this piece and this piece,' you're getting every big piece that's out there," he tells CNBC Make It.

The rate of return for each index fund is determined by the performance of the companies that are in it, which can balance each other out. Say you buy an index that contains only two companies, and one goes up by 3 percent but the other goes down by 2 percent. In that case, you're still up by 1 percent overall.

That's partly why index funds are considered a form of passive investing. "Instead of you and your analyst team identifying which stock you want to buy and when you want to buy it and when you want to sell it, you say, 'No, we're gonna buy exactly what's in the index and weighted for that particular index,'" Smith says. "You're not making any decisions, you're just buying the index as it's there in front of you."

A major advantage of investing in index funds is that they're low-cost. That's because they don't require much effort to manage: You just purchase the index and let it do its thing instead of following, buying and selling shares in particular companies.

Similarly, index funds are tax efficient because they don't require much trading. Managers are "not constantly buying and selling within that fund," Holeman tells CNBC Make It. "Anytime that you do a lot of buying and selling, there's the potential to cost yourself a lot in taxes."

For consumers, that can translate to more money in your pocket. Because you aren't paying an advisor as much as you would for actively managed funds, you're probably saving money in fees that could cut into your returns, Holeman says.

Warren Buffett agrees: "Costs really matter in investments," he says. "If returns are going to be 7 or 8 percent and you're paying 1 percent for fees, that makes an enormous difference in how much money you're going to have in retirement."

Buffett is a proponent of index funds as a way to boost long-term investments, such as retirement savings. "Consistently buy an S&P 500 low-cost index fund," he told CNBC's On The Money. "I think it's the thing that makes the most sense practically all of the time."

"The trick is not to pick the right company," Buffett says. "The trick is to essentially buy all the big companies through the S&P 500 and to do it consistently."

That said, it's important to remember that diversification is key. Always make sure that you'redoing your homework and consider working with a financial professional (as long as they're afiduciary) to craft a investment plan that makes the most sense for you.