Hard-deprecated methods can be removed when they have been emitting deprecation warnings by calling wfDeprecated for at least three months, and the call to wfDeprecated is included in at least one stable release (see the Stable Interface Policy).
As of April 2024, all methods that had been hard-deprecated in the 1.41 release can be removed (See https://phabricator.wikimedia.org/source/mediawiki/browse/REL1_41/ for the code of that release).
Code search can be used to find calls to wfDeprecated. For instance, to find methods that have been soft-deprecated in 1.39 or earlier, use https://codesearch.wmcloud.org/search/?q=wfDeprecated%5C%28.*%2C+%271%5C.3&files=&excludeFiles=&repos=MediaWiki+core
Note however that the version number in the call indicates when the code was soft deprecated by tagging it. Sometimes, a method was soft-deprecated for many releases, but only got hard deprecated recently - so a method that says 1.35 in the wfDeprecated call can probably be removed, but if that call to wfDeprecated wasn't present in the 1.41 release, then it can't be removed yet.
Also, codesearch should be used to double-check that the method in question is no longer used in any deployed code: https://codesearch.wmcloud.org/deployed/. If remaining (ungated) usages are found, a ticket should be filed about that issue.