How to tell: your mouse cursor is spinning or the window is saying it is not responding and you can't do anything in GIMP.
How to fix: some filters and other operations can take a long time, especially on large images or if your computer does not have a lot of free memory. In these cases, you may just need more patience. It can sometimes help to reduce the part you are working on by making a selection around a specific area.
GIMP, just like any other software, is not perfect. You may have found a bug. The best thing to do is report it, since you may be the first to encounter it. Not reporting it may mean it won't get fixed until someone else reports it.
First check to make sure that you are using the latest version of GIMP; if not update and check if the problem is still there. If it is, check if the issue is already known by searching our list of issues (also check the closed issues, fixed issues get closed even if there is no new version available yet). If you don't see it there, please open a new issue, making sure to give us all details like your Operating System, GIMP version, what tool or filter you were using and what exactly happened. Adding a screenshot, or uploading the image you are using can also be helpful in certain cases.