Compute values to display on the user profile page based on other user profile field values
You can make use of hook_entity_extra_field_info() . Below is the following code snippet which you can use in your module:

/**
 * Implements hook_entity_extra_field_info().
 */
function my_module_entity_extra_field_info() {
  $extra = array();

    $extra['your_entity']['your_content_type']['display']['my_own_pseudo_field'] = array(
      'label' =&gt; t('My own field'),
      'description' =&gt; t('This is my own pseudo-field'),
      'weight' =&gt; 100,
      'visible' =&gt; TRUE,
    );
  }

  return $extra;
}
And you can use hook_ENTITY_TYPE_view
/**
 * Implements hook_ENTITY_TYPE_view().
 */
function my_module_your_entity_view(array &amp;$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
  if ($display-&gt;getComponent('my_own_pseudo_field')) {
      $build['my_own_pseudo_field'] = [
        '#type' =&gt; 'markup',
        '#markup' =&gt; 'This is my custom content', 
    ];
  }
}


Please replace the entity and entity type with your requirement. Since it is only for the display this code snippet will work . Clear the cache you will find this field in manage display section .