I need to get a field type programmatically.
Sometimes, you need to add a field to an entity programmatically. Entity storage will automatically process the storage in most cases. This technique is especially good with computed fields.
Sometimes you need to get all fields that belong to a node content type and cycle through them. This is how you can get all content type field definitions in Drupal 8.