Testing new websites on different devices

I read somewhere that, in the testing phase of making a website, you need different kinds of hardware to test them on. For example, testing on android vs. iPhone and so on. Is there an alternative to this kind of testing where I would have to go out and find a bunch of different phones and laptops to buy and test with? Someone suggested a website that lets you connect to a mac remotely or something in another topic I made. I just want to know what a good method is. I’ve been coding away and just now realized that this might be a problem.

image

Your browser should let you emulate your application at a bunch of different screen sizes. In chrome if you open up the developer tools and click the blue highlighted icon in my screenshot you can choose from a set of common devices or set your own custom screen size

image