For example your block class is

<?php
namespace Azthemes\Helloworld\Block;
use Magento\Framework\View\Element\Template;

class Main extends Template
{
    public function getMyCustomMethod()
    {
        return '<b>MyCustomMethod</b>';
    }
}

then in any phtml file you can use following code to get method of this block.

<?php
$blockObj= $block->getLayout()->createBlock('Azthemes\Helloworld\Block\Main'); 
echo $blockObj
->getMyCustomMethod(); ?>

Hope this helps you.