Use getElementById() to find an element by its ID attribute. IDs should be unique on the page.
const header = document.getElementById("header");
console.log(header.textContent);
This returns the element directly, or null if not found. It's the fastest way to select a single element.