Search form in header

Hello :smile: , I am trying to find out how to add a search form to my header that minimizes in mobile view. How can this be done? What is best approach?