Partly inspired by this question, the end result of stellar fusion is Iron-56 (eventually, after some decay). Then it explodes. How/where then to the heavier elements come from. The answer here mentioned two colliding stars form gold. What process is taking place to form this gold (and I'd assume the rest of the heavier elements)?
The r-process occurs in supernovae. Under the extreme conditions leading up to it, heavy elements are initially blocked from undergoing beta decay to other elements. If a heavy atom captures a nearby neutron, it can go to a heavier isotope or element. This happens multiple times to an atom, producing heavy elements.
The s-process is slower, and occurs under less dramatic conditions in asymptotic giant branch (AGB) stars - a certain type of red giant. It also uses neutron capture and the subsequent decay of that neutron into a proton. Over thousands of years, atoms climb to become heavier elements. The s-process, though, requires that there already be some heavy elements in existence, unlike the r-process.
HDE226868's answer is perfectly correct. Just to add the following important information though.
The s-process is limited to elements lighter than lead and produces little peaks of abundance at certain elements along the s-process path - eg. Ba, Sr, Eu, Y. These are often called s-process elements. All the elements heavier than lead are produced by explosive r-process nucleosynthesis in supernova explosions, colliding neutron stars etc.
The split between r-process and s-process production of heavier than iron (peak) elements is about 50:50. ie They weren't mainly made in supernovae, which is a frequent, incorrect claim.
An update is also in order regarding the site of the r-process. In the past it has been thought that most of the r-processing occurs in the early stages of a supernova explosion. However, theoretical models have really struggled to get the environment as neutron-rich as required to produce the heavier elements - certainly those up around gold, platinum, osmium etc.
In the last few years it has become more popular to think that merging neutron star are the main site of the r-process. This hypothesis received a boost with the observation of a gravitational wave source source that appeared to be that of a merging neutron star system coinciding with a kilonova explosion seen in gamma rays, visible and infrared light. The infrared spectrum of the decaying light from this explosion betrays the presence of "lanthanide" elements that are produced in the r-process.
Note however that the rate and yield of such events is highly uncertain. There is plenty of good work which suggests that rare types of core-collapse supernovae (aka "collapsars") are still in fact the dominant source of r-process elements in the Milky Way (Siegel 2019).
The relative contributions of various sites to the r-process remains an unsettled matter. You could also read my answers on this topic in Physics Stack Exchange.