You can wait for the tasks to complete, which would be the best route. Unless the background tasks go on beyond a reasonable time, it is a normal process. Or you can try Force Quitting iMovie to halt the process . Then reopen and try again to export.
If you have an extra long movie, or, for example, 4k with complicated edits, iMovie might need to do some background prepping and tidying up before rendering the movie. Or perhaps you are running low on free disk space on your external drive, and this could slow down the rendering process.
You might try creating a new project with a few simple unedited clips, and see if the problem persists.
Also, sometimes deleting preferences can cure issues. To delete preferences close iMovie and reopen iMovie while holding down the Option and Command keys and selecting to delete preferences in the box that appears. iMovie will open in a new empty library. Reopen your old library to get back to your projects. Now see if you can export more quickly. You may need to restart your Mac to set the preferences. Deleting preferences is a safe procedure that wil not cause loss of date or disruption to any project.
-- Rich