If you use an iPhone and want to search for messages on the WhatsApp application, just access the conversations, scroll down the screen, tap the "Search" button, type the search terms and select the conversation you are interested in from the results proposed.
Steps
Method 1 of 2: iPhone

Step 1. Tap the WhatsApp application icon located on the "Home" screen

Step 2. Tap the Conversations button with your finger

Step 3. Scroll the screen down
By doing so, you can see the search bar.

Step 4. Tap the Search bar

Step 5. Type a term
You can search through sent messages or contacts you have had a conversation with. The application checks all chats to find the one that matches the criteria you entered.

Step 6. Select the conversation among the proposed results
This way, you can open it and highlight the search term that is contained in it.
Method 2 of 2: Android

Step 1. Tap the WhatsApp icon
You can find it in the application list.

Step 2. Tap the Chat section

Step 3. Select the button similar to the magnifying glass
You can find it in the upper right corner of the screen.

Step 4. Type a term
You can search based on the words contained in the conversations or based on the contacts you have exchanged messages with.

Step 5. Tap the conversation you want to open from those that appear in the results list
The application shows all those that match the search criteria you entered. Tap the chat showing the highlighted term to open it.