How waves reflect at the ends of a medium, or at the interface between two media, is critical to understanding things like musical instruments.

When a wave encounters a fixed end, for instance, it comes back upside down.

When a wave encounters a free end, it comes back the same way it went out.

Right End is:

The actual string is shown at the bottom in purple. A pulse moving to the right is shown in red, and the reflected pulse, moving left, is shown in blue. What the actual string does is the superposition of the top two pictures.