These heaver-than-iron elements are created in a very interesting and exotic process. When a large enough star dies it explodes in a supernova, and a huge amount of energy and neutrons are released in a very short period of time. This supernova generates enough energy and neutron material that small amounts of heavier elements like gold, platinum, etc. are created through exotic nuclear fusion reactions, even though these heavy fusion reactions are energy-absorbing.
It's interesting to think when you're wearing jewelry made from gold or platinum, all of those atoms in your jewelry were created during the death of a star.