First, there is a JavaScript version and a PHP version. Both need to be used.
Second, the actual form ID and field ID are not part of the PHP code. The parameters $form_id and $field_id should be left as is. They are passed in to the filter: you don’t set them.
Finally, the red X was previously used to be the delete icon, but it was confusing to some users, thinking it meant there was an error. For that reason, the red X was changed to a trash icon.
The use of dashicons is currently being evaluated and may be changed in a future version, due to the weight of that file.