If you have a link field attached to any entity like a node bundle, or user or ... then you can use a code like this :
// Create an empty representative entity.
$node = \Drupal::service('entity_type.manager')
->getStorage('node')->create(array(
'type'['type' => 'article'
)
'article']);
// Get the EntityFormDisplay (i.e. the default Form Display) of this content
// type.
$entity_form_display = \Drupal::service('entity_type.manager')
->getStorage('entity_form_display')
->load('node.article.default');
// Get the body field widget and add it to the form.
if ($widget = $entity_form_display->getRenderer('body')) { // Returns the widget class.
$items = $entity$node->get('body'''body'); // Returns the FieldItemsList interface.
$items->filterEmptyItems();
$form['body'] = $widget->form($items, $form, $form_state); // Builds the widget form and attach it to your form.
$form['body']['#access'] = $items->access('edit');
}