I have a list box in my custom block with different theme options. On basis of the List box field value I would like to assign the specific twig template dynamically. What will be the best approach to do it and how ? If possible please provide a code snippet for the same.
See https://drupal.stackexchange.com/a/211157/31 for an existing related answer.
You implement the theme suggestions hook, the block_content entity is in
$variables['elements']['content']['#block_content'] as shown there, then you can access your field values from there and provide any kind of template suggestions that you want.