I heard that hardware wallets are the way to prevent that... but what would be the best one?
Best depends on your needs (usability, safety, number of different altcoins you want it for along with bitcoin). It's hard to tell which is "best".
This is exactly the case, that each crypto-user has his own needs and it is impossible to say which of the proposed options OP needs. This can only be determined by him, personally for himself, but as is usually the case with beginners, he doesn't have sufficient knowledge and experience. Therefore, beginners want to hear and expect a ready-made solution from others, for which such topics are created. Of course, experienced people share their advice and recommendations, but beginners should do the main work themselves: by analyzing their needs and choosing the right crypto wallet after evaluating offers on the market. Most people are too lazy to do this and they want an easy ready-made answer.
I heard that Trezor or Ledger hardware wallets are pretty good... but what do you guys think?
Yes, they're are the most used ones because they have an older history and reasonable prices.
However, Trezor doesn't have secure element chip and Ledger has a recent history of fuckups, from getting customer info (incl. addresses) stolen to faulty parts.
Plus, for Ledger and Trezor (and others too) the communication with the companion software wallet is done via cable (arguably no longer air gapped) or Bluetooth (arguably not that secure).
If this is a problem for you, you may also read about
SeedSigner, which uses images for communicating with the software wallet, but keep in mind that this is basically a Raspberry Pi with custom software, hence no secure element and the name is not Hardware Wallet, instead it's an air gapped signing device. Bitcoin only.
When it comes to hardware wallets, these 2 brands are always remembered first of all: old and well-known, which are on everyone’s lips and their names have become household names, personifying hardware wallets. Of course, you can experiment with new devices, but which of the newcomers is ready to take risks? Among new hardware manufacturers there may be interesting and good solutions, newcomers will still prefer proven brands. New items are the lot of crypto-enthusiasts and technically capable people. Mostly.