Instead of trying to hunt through all your messages for a specific one, you can narrow the search by viewing only known or unknown senders. First, go to Settings, select Messages, and then turn on the switch for Filter Unknown Senders if it's off.
Next, open the Messages app. On an iPhone, tap the Filters link at the upper left. On an iPad, tap the sidebar icon at the upper left or drag the Messages pane to the right. Tap Known Senders to see messages only from people you know. Tap Unknown Senders to see texts from strangers, including those with one-time codes or verifications. While you're here, you can also filter the list to see just unread messages.