How do I call a theme function? Can someone tell me that how can I call theme function, in Drupal 8, within other hook function?

Of course, we should write hook_theme function.

For example (in Drupal 7): theme('THEME_NAME');

What is wrong in below snippet:

function theme_sometheme($variables) {
   $another_theme = array('theme' =&gt; 'another_theme_for_test', 'arg1'  =&gt; 'value');
   return '&lt;div&gt;'. drupal_render($another_theme) . '&lt;/div&gt;';
}


Note: Above code is not rendering anything.
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.