Friction is responsible for an estimated 20-30% of the world's energy consumption but remains ill-understood. This is because of the difficulty of observing directly what happens at the interface: how do two (rough) surfaces contact each other, and how does the sliding change this? We develop, in this project, new tools to answer these century-old questions. To this end, we use molecules whose fluorescence depends on the environment, and notably molecules that start to fluoresce when they are confined in a frictional contact. Using optical microscopy, we can then do the contact mechanics, and observe what happens to the contacts when the surfaces start to slide with respect to each other. We also co-developed molecules that are sensitive to the local stress in the frictional contact. We can therefore now for instance understand where the difference between static and dynamic friction comes from, which is very important for understanding and predicting earthquakes. We also investigate whether the environmentally sensitive molecules can be used to measure local viscosities in polymer glasses when these go through the glass transition. Also here, a very heterogeneous (bulk) dynamics is anticipated from theory, but very few local measurements exist. Again, the fluorescent molecules open up a new window into the very old problem of the nature of the glass transition.