A necklace having gold and gems in it was brought to Messenger of Allah ﷺ in Khaibar and it was one of the spoils of war and was put to sale. Messenger of Allah ﷺ said: The gold used in it should be separated, and then Messenger of Allah ﷺ further said: (Sell) gold for gold with equal weight. (Using translation from Muslim 1591a)
سَمِعْتُ فَضَالَةَ بْنَ عُبَيْدٍ يَقُولُ أُتِيَ رَسُولُ اللهِ ﷺ يَوْمَ خَيْبَرٍ بِقِلَادَةٍ فِيهَا خَرَزٌ وَذَهَبٌ وَهِيَ مِنَ الْمَغَانِمِ تُبَاعُ فَأَمَرَ رَسُولُ اللهِ ﷺ بِالذَّهَبِ الَّذِي فِي الْقِلَادَةِ فَنُزِعَ وَحْدُهُ ثُمَّ قَالَ لَهُمْ رَسُولُ اللهِ ﷺ «الذَّهَبُ بِالذَّهَبِ وَزْنًا بِوَزْنٍ»