Start by deleting preferences.
To delete preferences, hold down command and option while starting FCP X and click Delete Preferences.
The application will start in a default state, and open an "Untitled" library.
Reopen the library you were working on, set the preferences the way you like them, and try again.
If deleting preferences does not fix it, you have to tell us exactly what version of macOS and FCP you have, what your mac is, how much free space on the drive.
For more complete information, also please run Etrecheck and post its full report here.
Use the "additional text" button and paste the report into the text box.