How to redirect a menu item to the anchor? I have created menu with sub-menus. The menu block is placed on the specific page.

Drupal menu path allows only allows normal path to be given to menus(like node/nid and pagepath).
I want to give path like node/256#myblock.

I do not want to go with contributed modules(void menu or any other) as this is for the single link in my site.
Modules are how you extend Drupal's functionality; there's very little point saying you want to achieve something without a module, as if one exists, you're just going to end up copy/pasting its code into your own module/theme anyway to get the same effect.

Drupal core has no functionality to link to an anchor, so you need to install a module which does, or copy the code from one to your own.

Whichever of those methods you decide to use, Special Menu Items has the functionality you require (you can either install
and use it as normal, or pick the relevant bits of code out into your own module/theme).