Have you ever wondered why after you went and looked at some item on a website, why lots of ads appear after that for that item and for that company? The answer is cookies.
Cookies are small files that are stored with your web browser by different sites that you visit. The groups that post the ads on your pages (Google being the largest and their main money-making item) place a cookie on your machine whenever you visit sites and look at stuff or search for stuff.
If the ad placers know things you are interested in, then you are more liable to click on the ads and buy stuff and the advertisement placers make more money. If I go looking for shirts and then click on Walmart and Sears in the results and look on those pages, then the cookies will be stored saying I looked at Walmart and Sears and I was looking at menís shirts. Now when Google and other ad placers put ads on my pages they will place more of Sears and Walmart and of different places offering shirts. This may be helpful to me to find more variety of types and prices of shirts.
The problem with this is that a typo will drive you crazy or clicking on a wrong link. My typing is not perfect so I may have typed a k instead of an h. I then get bombarded by ads for the next few weeks for skirts which I am not interested in buying. Or you clicked on something wrong or went to a site you only wanted a quick glance and now bombed with ads.
How do you stop the ads? One is that they will gradually replace with new things you search for, but that may not be good or comfortable for you. The way you can generally stop them, so they reset and start building a history on you new is to delete the cookies on your machine connected to the browser. In Chrome you do this by clicking the button in the top right that has three vertical dots. Then choose Settings, then advanced (bottom of list). Then at the bottom of the Privacy and Security box is a link to clear browsing history. Click it. Make sure Cookies is checked and click delete. This will clear your cookies.
However, if you delete cookies then your pages all go back to their defaults when they start, and if you were used to the pages opening at certain points or remembering things about you, when you delete cookies you delete all they know on you and your browsing habits.
Now if certain ads are driving you crazy you at least know why and may be able to stop them.