What happens if I use OLS in a multiple regression but the sample is not random? I know that, to use OLS estimators in linear regressions, there are few assumption to be satisfied. However, it is not clear to me what would happen if I would use OLS in a multiple regression without having a random sample, so that (Xi, Yi) would not be iid. Which sort of problem may I face? 
 A: First, OLS is nothing more than an algorithm for fitting a linear model of the form
$$
y = \mathbf{X\beta} + \epsilon
$$
In other words, you are positing that the phenomenon $y$ is a linear function of the variables $\mathbf{X}$, plus some additively separable disturbance term.  
If this is a good assumption, then there is some true, constant $\mathbf{\beta}$, and you apply some estimator -- such as OLS -- to estimate what it is.  
If your sample is non-random -- there is some correlation between your $\mathbf{X}$'s and your error term -- then OLS estimates of $\mathbf{\hat\beta}$ will not be equal in expectation to the true $\mathbf{\beta}$.  This is to say that they are biased.
In other words, if you were to take many many samples from the population of $\mathbf{X}$ and $y$, your average $\mathbf{\hat\beta}$ would not equal $\beta$.
A: When the sample is not random, you have to consider whether the way you got the sample introduced bias. That is, the way data was gathered IRL can affect the extent to which the sample is representative of the population.
For example, say you want to predict who someone is going to vote for based on their media habits. You get the data from asking your friends. The problem is that your friends are probably not going to be representative for the population at large.
Why? One reason could be that we tend to become friends with people who share similar media preferences (maybe you became friends partly because you both love the same youtube channel). Another could be that friends tend to have the same socioeconomic status, and socioeconomic status affects which types of media that are consumed.
In this case, when you do your OLS, your regression coefficient will reflect your friends, but it's very hard to say whether it reflects the population at large. If you're only interested in your friends, that's fine. If you want to generalize, you're in trouble.
According to (Mercer et al., 2017), for non-random samples you basically have to consider whether your non-random sample reflects the population... in terms of confounders.
For example, if all your friends have the same gender as you, sampling your friends is going to be a problem because gender likely affects media habits.
But an all male sample might not be a problem. E.g. if you're testing a new pill for erectile dysfunction, you're probably OK going with an all male sample. Basically, it depends on the theoretical knowledge of your field.
When we start to appeal to the theoretical knowledge of our field, we are moving out of statistics and into the world of causal inference (see e.g. Pearl's Book of Why).
Random sampling (of the population) is a way to not have to deal with any of this. With random sampling (from the population) you can say "I know the way I gathered the data didn't introduce bias, because it was at random".
Randomization protects you from the known, the unknown, and the unknown unknown sources of bias.
