What is difference between Gasket and O-ring?

Both gaskets and O-rings are used to create a seal between two surfaces, but they have some key differences in terms of design, function, and application.