You can search all of your messages in Google Chat or search for messages that include specific people or certain types of content, such as images.
To search across all content in Chat:
Click in the Search box along the top of the screen
Type any keywords to find, then press Return
To search within a specific conversation or space:
Click on the conversation or space you wish to search
Click on the Search button on the right-hand side of the screen
Type the keywords you wish to find, then press Return