Creating custom blocks
From the above code replace:

use Drupal\block\BlockBase;


with:

use Drupal\Core\Block\BlockBase;


Then Flush cache and check.
Go to Structure, BlockLayout and click on Place block.