You have plenty of choices.
Cheap and effective, use DNS round robin, nearly all the big players use that (although not only for failover). Here's an example:
$ host amazon.com
amazon.com has address 220.127.116.11
amazon.com has address 18.104.22.168
amazon.com has address 22.214.171.124
amazon.com mail is handled by 5 amazon-smtp.amazon.com.
In this case it's the browser that handles failover. It's quite effective actually and all you have to do is configure your DNS entries.
Another choice not limited to HTTP / SMTP can be having hardware load balancers as for example F5's BIG-IP.
Then there is a plethora of other solutions and no space to list them all but it's easy to google for them.