I wanted to buy my own server instead of constantly renting one. But now I don't know what servers are suitable for. I have already thought of a Raspberry Pi but then read that it should not be so suitable.
Do I understand correctly? Do you want to get a physical server and then run it at home? And only for a Minecraft server?
That will not pay off economically. Even if you can get a cheap server, it must of course run 24/7 → electricity costs. To do this, you have to set up the entire server yourself and install all the necessary packages and of course also perform maintenance work.
That means you need a sound knowledge of the installed operating system and also knowledge of Minecraft servers and their installation and setup.
In addition, the internet connection will probably not be sufficient. There are reasons why servers are in data centers ^^
I was doing the same thing you did six years ago. I even implemented it and set up the server at home and made it ready for Minecraft.
I can tell you: there are too many negative points compared to the rental server. Effort and costs (in the shorter term) are higher.
If you really want to do this, buy a place in the data center (colocation or server housing). Then the server or servers are set up and integrated into their network.
However, this is extremely expensive and it would not be worth it for a single populous server. Since you mentioned the Raspberry Pi, I guess that you don't want to spend too much money on it. In that case, you can unfortunately forget the idea directly: /