Abu Huraira reported Allah's Messenger (ﷺ) as saying:
When the time draws near (when the Resurrection is near) a believer's dream can hardly be false. And the truest vision will be of one who is himself the most truthful in speech, for the vision of a Muslim is the forty-fifth part of Prophecy, and dreams are of three types: one good dream which is a sort of good tidings from Allah; the evil dream which causes pain is from the satan; and the third one is a suggestion of one's own mind; so if any one of you sees a dream which he does not like he should stand up and offer prayer and he should not relate it to people, and he said: I would love to see fetters (in the dream), but I dislike wearing of necklace, for the fetters is (an indication of) one's steadfastness in religion. The narrator said: I do not know whether this is a part of the hadith or the words of Ibn Sirin.
Reference: Sahih Muslim 2263 a
In-book reference: Book 42, Hadith 9
USC-MSA web (English) reference(deprecated numbering scheme): Book 29, Hadith 5621