I'm not sure that I've fully understood your question so I'll try to cover both of the possibilities that occur to me:
1. If you usually enter search terms into the box that appears at the top right of some browsers (e.g. Firefox) you need to be aware that it's quite easy to accidentally change the choice of search engine which is used, so perhaps you've selected Yahoo by mistake. If so, you'll see a 'Y' logoat the left-hand-side of that box. To change it to Google (or something else, such as Bing) simply click on that logo and a drop-down list will appear.
2. If you're suffering from any other type of browser re-direct, it's probably due to malware having found it's way onto your computer. Runniing the free version of Malwarebytes Anti-Malware (using the so-called 'quick' scan, which usually takes over half an hour) should fix the problem:
https://www.malwarebytes.org/free/
NB: Deselect the option to install a trial of the 'PRO' version. When the scan ends, click to view the detailed results and then click again to remove everything that's been found).