getCustomFieldObjectByName method is deprecated, Need to modify the scripts to use getCustomFieldObjectsByName method.

After using getCustomFieldObjectsByName(String) it removes warning but it throws error in other line which is shown below

Help me with fixing the warnings without any errors?