When you look at the sky with a refractor or Schmidt-Cassegrain telescope, the eyepiece is pointing downwards. To avoid contorting yourself or kneeling on the floor while observing, you use a diagonal mirror or Amici prism. The result: a light path deflected upwards through 90° provides a comfortable viewing position.
The prism has a triangular shape, like a house roof. This house roof is positioned at 45° in such a way that the surfaces stand in the light path. When a beam of light hits the surface, it is deflected by 90° and enters the eyepiece.
A diagonal mirror works in a similar way. It consists just of a mirror, which is set in the housing at exactly 45°. Thus, star diagonals and diagonal mirrors have the same effect.