A 401k can be invested however you want. You can choose if you want to invest it in stocks or bonds with more of less risk, or in something that has no risk (basically a savings account within your 401k). So there is no way to answer your first question.
FWIW, we’re about 10 years from retirement and are still investing in index funds.
To your second question- if you need the money in a year or two, a high yield savings account (HYSA) is your best bet. If it’s a bit longer, you could put it into a CD- though they have minimums, I think. If it’s basically savings that you want to keep for retirement, invest it in a brokerage account based on how much risk you want to take on