Module Development - Get ID of a field within a Matrix field
You'll need to loop through the fields in the blocktype definition for your Matrix field. For simplicities sake, I've supplied a loop, which you can cut-down if you have a specific block type in mind you just want to fetch for:

$matrixField = Craft::$app-&gt;getFields()-&gt;getFieldByHandle('myMatrixFieldHandle');

foreach ($matrixField-&gt;getBlockTypes() as $key =&gt; $blockType) {
    Craft::dump($blockType-&gt;name);

    foreach ($blockType-&gt;getFields() as $key =&gt; $field) {
        Craft::dump($field-&gt;name);
    }
}