Can you give us a few more details about the problem? This is not a common occurrence so additional details can help us help you. For example, iMac model, macOS version, FCP version, how much free space on the system drive, any external drives and how they're connected and formatted. An easy way to provide these answers is to paste an https://etrecheck.com report here using the "Additional text" button below in your reply.
What troubleshooting steps have you tried? Have you reset FCP Settings? Hold option and command while launching, the choose Delete Settings. FCP will open the default Untitled library. Reopen the library you were working on, configure the settings the way you like (disable background rendering, etc.) and see if the problem has been resolved.
What are the specific specs of the media that causes the crash? Open the clip in QuickTime Player and post a screen shot of the Get Info window with all the details twirled open.
Can you successfully import anything or does FCP crash no matter what's imported?