I am very confused by this because when I watch videos or read about MLE with linear regression it seems to be commonly assumed that $X$ is fixed or that if it is random we don't care for the purposes of estimating $Y$ using $X\beta$, as $X$ is assumed to be already known.

Assuming I have understood that reasoning properly, why is this so? It's very strange because $X$ seems to be random very commonly in regression scenarios. I've seen a couple threads about this and I don't really understand.