If you really don't know, then it is a good idea to keep holding that money in your bank account while you think about what to do with it. Without knowing anything about your personal situation, your goals, the state of the economy in the country, region or locality you live in, it is impossible to give you advice on what to do. But there are some things to consider regarding the state of world economy if you plan on investing and saving further.
- The stock market has been rising for nearly a decade uninterrupted. It looks increasingly likely that there will be a correction. Nobody knows exactly when but no market goes up uninterrupted forever.
- The price of silver has about halved since 2013. Gold is about one third cheaper than in five years ago. I'd look into those. Read everything about them.
- I'd keep an eye on the price of Bitcoin. I'd consider investing some when I see clear signs of it bottoming out.
This is not financial advice but personal opinion. Always do your homework before investing. Take qualified professional advice if you don't know what you're doing.
Everything depends on your personal situation, € 40,000 is both a lot and very little!
If you have children, it is a good sum to put on booklets A to make a savings of security (available in case of hard shots).
If you are happy in your job, you can take a part (10k) and test a small rental investment (100 / 120k €), it will allow you to learn.
If you prefer not to bother you, take shares of scpi or other investment funds (be careful, do not go all of a sudden, smooth over several months).
And if you like the taste of risk, put up a box, 40k is a good contribution to start!