I see that two examples in optics have been mentioned, a diffraction grating by Mark Eichenlaub, and a lens by sigoldberg1. I would like to elaborate a bit, because there is a subtle difference between the two.
On the one hand, a diffraction grating separates out light of different frequencies, i.e. colors, transforming them into different positions. This is analogous to how the 1-D Fourier transform works on a sound or electrical signal.
On the other hand, a lens takes the 2-D Fourier transform of a monochromatic light beam. Monochromatic means there is only one frequency or color. You might wonder why the Fourier transform isn't a single peak, if there's only one frequency in the light. That's because a lens transforms spatial frequencies (roughly equivalent to angles, but I will explain them below) into positions. Mathematically, this is the same Fourier transform, but it transforms an entirely different property of the light.
It took me the longest time to understand exactly what spatial frequencies were. I finally got it one day, reading chapter 4, "Fourier Optics", of Saleh and Teich's Fundamentals of Photonics, which I whole-heartedly recommend if you don't understand my explanation here.
You probably learned in your class that you can write any signal as a Fourier series, which is the sum of frequency components, each with their own amplitude and phase. The Fourier transform is a sort of continuous version of that. Well, you can express any monochromatic light beam as the sum of many plane waves traveling at different angles, all with the same frequency, but each with their own amplitude and phase. Is this starting to sound familiar? Each of these plane waves is a spatial frequency. Just as with the step from Fourier series to Fourier transform, you can make the step from discrete spatial frequencies to 2-D Fourier transform.
A positive lens focuses each of these spatial frequencies to a separate point. For example, here are illustrations of two different plane waves being focused by a lens.
When a plane wave hits a lens face on, the lens focuses it to a point on the optical axis, at the focal distance of the lens.
However, when the plane wave is incident at an angle, the focus is still at the focal distance, but displaced from the optical axis. This is how a lens transforms "angle" to position.
So if you have a more complicated beam made up of many spatial frequencies (which, as I said, are just plane waves), they are all focused to separate points in the same plane on the other side of the lens, one focal distance away. This is why we say it computes the 2-D Fourier transform of a monochromatic light beam. In fact, in the 1970s, when computers weren't so fast, people actually experimented with using lenses to calculate Fourier transforms instantaneously!