On the surface it sounds like you are the victim of various types of (potentially malicious) popups. Some pop up on top of your work, some underneath and occasionally kill what you are doing. Some are specifically designed NOT to be closed easily and force you to go to some level of effort to remove them (such as use Task Manager). Some even reopen right away and never seem to go away.
There are generally three ways to deal with them
1) Don't access sites that have these popups in the first place (usually somewhat difficult to know about ahead of time)
2) Some of the browsers have some sort (usually minimal) popup stopping settings built in. Since you did not note what broweser you were using, this would require further feedback from you.
3) Probably the best way - get a good popup stopping program. Some of these cost $$ and some reasonally good ones also are available free. Again I suggest further feedback before figuring out what to suggest.