Prerender callbacks must be methods of class that implements Drupal core security TrustedCallbackInterface Drupal 9 PHP exception

After upgrading to Drupal 9, when i tried to edit a node got error:

‘PHP message: Uncaught PHP Exception Drupal\Core\Security\UntrustedCallbackException: “Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was field_group_form_pre_render. See" at /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php line 96’

This is fixed by identifying which module is doing the old-style inapplicable callback and updating to the new better ways.