define a template file for a field item in my modules I wish to register a template file for use with a filed item, but I can't wrap my head around it.

here is what I am trying to achieve.
In my field widget Formatter

public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];

foreach ($items as $delta =&gt; $item) {
  $elements[$delta] = [
    '#markup' =&gt; $this-&gt;viewValue($item),
    '#theme' =&gt; 'my-field-item-template',
  ];
}

return $elements;


}

Then in my .module file

function mymodule_theme($existing, $type, $theme, $path){
return array('myplugin' =&gt;
    array(
        'variables' =&gt; array(
            'other elements' =&gt; 'other elements',
            ), 
            'template' =&gt; 'my-field-item-template'
        )
    );


}

I wish to print my 'variables' in my twig file, I believe my template file is not registered for use with my field item this way. What's the right way?
In hook_theme you define and register your templates. 

In your code your template will be "myplugin".
To use that template you need to specify "#theme" => "myplugin" in your render array (not my-field-item-template). Then twig tries to render your content with the file called "myplugin.html.twig". This twig file should be stored in the templates directory of your module.

You may read this https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates to learn more about debugging theming.