Colours which look good next to each other are useful in Web design.  Partly it is personal taste but there are some principles which claim to help you to pick suitable colours.

Similar colours and their complement

These are simply colours close to each other on the wheel (with similar hue values) or with slightly different saturation or lightness.  In terms of hue a difference of about 15 degrees seems to work well such as these warm colours.  You can then choose a contrasting (opposite or complementary colour) of the middle of the three for a background to help the text to stand out.  Like these warm colours with a background.  The contrast may not be attractive but it helps readability.  If you don't like it you can drop the saturation and maybe increase the luminescence to still have a contrasting colour but less blatantly.

It would probably be better to use the three similar colours for text and reserve the contrasting, complementary colour for borders or emphasis and have a neutral background.

This approach of using a colour, it's complement plus the two colours either side of it is known as split complement.  Above the split colours were 15 degrees either side of the main colour.  You can use more or less difference for example 30 degrees is more brash these warm colours with a background.

Triads and tetrads

These are simply colours spaced equally around the wheel (3 or 4 of them).

So what?

For many of us we are happy to randomly pick a few colours and see what works.  However, if your main emphasis will be on the visual design of Web sites you should probably try using hsl and understanding colour and the colour wheel.