How do I call a theme function?
The correct code is using the following line.

$another_theme = array(
  '#theme' =&gt; 'another_theme_for_test',
  '#arg1'  =&gt; 'value'
);


That is similar to the following code you find in rdf_preprocess_comment(). The only difference are the theme applied, and the arguments that theme requires; the way you pass the theme name or its arguments is the same.

$variables['author'] = [
  '#theme' =&gt; 'rdf_wrapper',
  '#content' =&gt; $variables['author'],
  '#attributes' =&gt; $author_attributes,
];
$variables['submitted'] = [
  '#theme' =&gt; 'rdf_wrapper',
  '#content' =&gt; $variables['submitted'],
  '#attributes' =&gt; $author_attributes,
];


Keep in mind that in most contexts you can just return a render array, which in your case is the following one.

[
  '#theme' =&gt; 'another_theme_for_test',
  '#arg1' =&gt; 'value',
];


The necessity to call drupal_render() is limited to very specific cases, so most likely you don't need it. If you do, you should use \Drupal::service('renderer')-&gt;render() instead.