Facebook is a vast community It has billions of users. As you know may be some reasons some of your friends got deactivated his/her account.
Now due to this there are a lot of inactive accounts are there in friends list. Now its, too hard to manually identify about that type account then unfriend them. so Here is a tool in termux or linux or ubuntu you can use it. This is a simple php script