How do I programmatically get the field type of a specific field?
With "get the field type of a specific field" you probably mean a specific field of an entity. There can be fields with the same name that have different types in different entities.

For example the field type of a field in a node: 

$field_type = $node-&gt;get($field_name)-&gt;getFieldDefinition()-&gt;getType();


can be different than that of the same field in a comment:

$field_type = $comment-&gt;get($field_name)-&gt;getFieldDefinition()-&gt;getType();