Access the field class from within FieldItemList (D8)
You first need to understand that the entity object in question does not have a property called myfield.

Drupal uses something called magic properties to mask the get method required for retrieving the field item list. See FieldableEntityInterface::get() for more information.

The second thing you should know, is that drupal treats all fields as multi value. That means that a field that is defined to have a single value would still be represented a list with a single item.

Finally, to answer your question, you can either use the FieldItemListInterface::get() method to get the field item object, it you can access it as though it was an array.

$entity-&gt;get('myfield')-&gt;get(0);

OR

$entity-&gt;myfield[0];