How can I display only products in search results?

Hello @j_adv21
Its Artzen Technologies! We will be happy to help you today.

Please follow the steps below: -
Step 1: Go to header.liquid file, find ‘routes.search_url’ and add code here:
Screenshot1 -

Step 2: Go to main-search.liquid file, find ‘routes.search_url’ and add code here:
Screenshot2-

Code:

This code will help you and solve your problem.

Let me know if need further assistance
Regards,
Artzen Technologies