If you do not buy hardware with Linux preinstalled, but instead buy new or used hardware that originally shipped with another OS or are thinking about doing so, then having a look at some websites that cover users’ experiences with the hardware will probably give you some indication of how well it works with Linux, if there are any issues that you have to remedy after installation and what sort of hardware is inside different computers and servers. Again, the easy way is to buy hardware with Linux preinstalled, but there are some good resources on the web that will help if you would rather use some other hardware, including Macs.
Generally, most hardware works quite well with Linux these days. A lot of hardware has open source drivers available in the Linux kernel or as packages you can install. Some hardware needs proprietary drivers (drivers that are not open source, but is available anyway). Most of the newbie-friendly distros like Ubuntu and derivatives (Mint, Ubuntu MATE, Lubunu, Xubuntu, Peppermint OS, Elementary OS…), PCLinuxOS, Manjaro… figures out what hardware you use upon installation and installs the right drivers automatically. On other distros like Debian and Arch that demands more user setup, you will have to install the right drivers yourself. Some distros like Fedora, Debian and OpenSUSE only ship with free software (open source) by default which means that to use these distros with hardware that demands proprietary drivers, you have to add third-party repos or enable the contrib and non-free repos in Debian. Some distros (Trisquel, Musix, Parabola…) are made specifically for only using free and open source software, and these generally have no way to install proprietary drivers.
If you use hardware that do not need proprietary drivers, then every distro under the sun will “just work”. Intel and AMD are both good at supplying open source drivers for their CPUs and GPUs (both newer integrated and external GPUs in AMDs case). Unfortunately, Nvidia only supplies proprietary drivers for their cards, but there is also a free software driver for Nvidia GPUs (noveau) that is good enough in most cases, but may give you a few fewer frames per second if you are a gamer. On newbie-friendly distros, both are often available, and you may choose which to use in a GUI. (For instance Ubuntu’s “Additional drivers” tab in the Software and Updates control panel.)
Wifi/Bluteooth cards usually need proprietary drivers, but both Broadcom and Intel supply these and most distros that are not free software only by default “just work” from the moment you start your computer, unless your Wifi/Bluetooth card is very obscure.
To further investigate particular hardware, I recommend looking at linlap (for laptops), Ubuntu certified hardware, ThinkWiki (for ThinkPads) and the Arch Linux Wiki. Many of these resources also cover Mac hardware, but there are also dedicated resources for that, such as Ubuntu’s Apple Hardware Users’ Forum, Ubuntu’s Mactel Community Documentation, and even a few blogs about Linux on PowerPC Macs.