A wave is a form of energy that travels from one point to another through disturbance.
Elastic waves in solids:
The force acting on the particle to restore their position is not the elastic wave but the motion in the medium under the action of the restoring force is known as the elastic wave. Depending upon the restoring force acting, the elastic waves can be longitudinal or transverse in nature.
Sound and water waves are examples of elastic waves. When a longitudinal wave travels through a medium it creates longitudinal stress due to compressions and rarefactions. So longitudinal waves can pass through solids.
When a transverse wave passes through a medium, the particle in the medium vibrates perpendicular to the direction of propagation. This will create shear stress. The solid material is capable of creating shear stress, so transverse waves can pass through a solid. That is both transverse and longitudinal waves will pass through solids