HTML
<body>
<div class="first-element">
<div class="some-child">Hi!</div>
</div>
<div class="second-element">
<div class="some-child">Bye!</div>
</div>
</body>
JS
const $second = document.querySelector('.second-element');
const $child = $element.querySelector('.some-child');
console.log($child.innerText);
// => Bye!
Reactだと↓のように使えたりして便利(子要素のref使えというツッコミはなしで
ref.current.querySelector('.some-child')