To get collection you need to do something like this,
=> Block File :
use [vendor]\[module]\Model\ExtratagsFactory; use Magento\Framework\Data\Collection; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; class Blockclass extends Template { protected $_modelextratagsFactory; public function __construct(Context $context, ExtratagsFactory $MainmodelextratagsFactory, array $data = []) { $this->_modelextratagsFactory = $MainmodelextratagsFactory; parent::__construct($context, $data); } public function yourfunction() { $MyCollection = $this->__modelextratagsFactory->create() ->getCollection(); return $MyCollection; } } This is your BlcokBlock file of your phtml file, and in phtml file you need to call like this,
=> phtml file :
$collection = $block->yourfunction();