Do any of the following:
Drag the conversation to the top of the sidebar.
Control-click the conversation, then choose Pin.
To unpin a conversation, drag it out of the section or Control-click it, then choose Unpin.
If you receive content that’s especially interesting and Shared with You is on, you can quickly pin it in Messages, and it will be elevated in Shared with You, Messages search, and the Details view of the conversation. See Send a message on Mac