Hello Saif2020,
Thanks for using the Apple Support Communities. We understand that you're having an issue with recording the screen of your Mac. Depending on what you're attempting to record, it's possible you're being blocked. This is mentioned in article, How to record the screen on your Mac under section: Learn more.
If you find you're OK to record the apps you're using, it might help to boot up into Safe Mode. This process is much like running disk utilities. It will do a basic check of your disk to see if anything needs repaired. It will also delete some system caches. Once you're in safe mode, go ahead and try a screen recording and see how it does. Also, go ahead after testing in safe mode, and reboot normally and try it again with normal startup.
How to use safe mode on your Mac
Best wishes.