Emergency fund

I have heard many financial advisors say to have a 6 month emergency fund. But they also say to not store money in the bank. Where should you put that 6 months fund? Is it true that you can take Money out of a Roth IRA with no penalty as long as it’s not the money that has gained interest. If that’s true would it be beneficial to put your 6 month fund in there and pull it out if you need it?

I keep mine in a high yield savings account. In the event of a true emergency when I need a large amount of cash, I don’t want to be worrying about the market potentially decreasing that money unexpectedly. And because I don’t know when the next emergency will happen, I don’t know when I’ll need that money. Could be tomorrow, could be in 20 years.

I know I’m not going to use retirement money for a whole, so that’s all in the market.