Overwrite module phtml file and re-write in own theme Magento 2

Some day ago I am facing one issue in magento 2  with overwrite module’s PHTML file in my custom theme,

So  here is the solution ,

Steps,

  1. Copy the Phtml file from module (For module location On template path hint)
  2. go to MAGENTO_ROOT/app/design/frontend/VENDOR/YOUR_THEME/MODULE_NAME/templates/filename.phtml

Here MODULE_NAME is your module name from you copy the phtml file In my case its Magento_Search.