Shared hosting is a web hosting environment in which several shared hosting accounts are created on a single main server, and each shared hosting account is sold to each customer. Shared hosting is cheap compared to other types of web hosting services but comes with less system resources and people say it is not very secure. If the main server goes down for any reason, all the shared hosting accounts and all the websites hosted on those accounts (hosted on that main server) go down too.
VPS hosting is a web hosting environment in which several virtual servers are created on a single main server, each one of these virtual servers has its own resources like RAM, CPU etc and acts independently. VPS servers are like mini-dedicated servers, if the main server goes down for any reason, all the virtual servers hosted on that server go down too. VPS hosting is expensive than shared hosting because it generally comes with more system resources.
Dedicated server hosting is a web hosting environment in which a full server with all the resources (like RAM, CPU, storage etc) are given/ dedicated to the customer who rents it. Generally dedicated servers are equipped with more resources like lots of RAM, CPU, Storage, Bandwidth etc, so they are costly. Dedicated servers give you a lot of options because the entire server is dedicated to you, you can do whatever you want with it. But as with most of the other web hosting services, if the server goes down for any reason, all the websites hosted on that server go down too.
Cloud hosting is a web hosting environment in which several servers are connected to one another to form a cloud which acts like a single server and provide web hosting to the hosted websites. Cloud hosting is much more reliable than any other type of web hosting service because even if a few servers within the cloud go offline, the remaining servers keep being in the cloud and continue to provide hosting services to the hosted websites. Cloud hosting offers auto-scalability, flexibility, stability, pay-as-you-use pricing structure etc.