Safari no longer defaults to typing in address bar. Why?
Your system could have been infected with adware and/or malware. See this Apple Support page on how to remove adware.

For malware, I have relied on Sophos' free Antivirus for Mac for several years. I use it on my home machines, and my school uses it enterprise-wide on all Mac and Windows desktops, laptops and servers.