If I don't remember what thread or channel I saw a message I hit the shortcut keys to get to the search bar and search for the sender using "from:@username".
That works well when I remember the sender, but I don't always notice who sent it :(
In those cases I go back in the history of chats that I visited with either CMD+[ or the dedicated "clock" button
Wait, what clock button?
EDIT: Holy shit, thank you!
You're welcome! Notice that you can go also forward in the history with CMD+] and If you happen to have back and forward buttons on your mouse (like an MX master) they also work ;-)
I do that too, thanks! Alt+left/right arrow works too, as normally for the browser.