Old accounts nobody uses are a quiet security risk. The first step is knowing which ones they are.
The lastlog command can filter on how long ago an account last logged in:
lastlog --before 90
This lists the accounts whose last login is more than 90 days ago. Accounts that never logged in show **Never logged in**, which is normal for service users like www-data and worth a second look for real people. To see the opposite, use lastlog --time 7 for accounts that logged in during the past week.
Combine it with a name filter to focus on human users: lastlog --before 90 | awk '$1 != "Username"' keeps the list readable, and lastlog --user alice checks a single account.
A caveat: lastlog reads /var/log/lastlog, which records console, SSH and similar logins. It can look empty on systems where that file is not kept, and it says nothing about accounts that log in some other way. Treat it as a hint, then check the account before you lock or remove it.
Further reading: lastlog(8) man page