It's easy to generate such a model for specific cases. For example, take the maximally entangled state $|\phi^+\rangle = \frac1{\sqrt2} (|00\rangle + |11\rangle)$, and let the observables in the CHSH inequality be $A_0=B_1=Z$, and $A_1=B_0=X$. Now if Alice and Bob measure in the same basis, they'll get results that are random but equal with probability 1, and if they measure in different bases they'll get completely random and uncorrelated results. This will give you a CHSH value equal to 2, so they don't violate it.
These are all the features of the state you can get by measuring these observables, so this is all you need to reproduce with your local hidden variable model. A model that does it consists of sending two bits to Alice and two bits to Bob, correlated such that the only possible pairs are
\begin{gather*}
(0,0) \quad\text{and}\quad (0,0) \\
(0,1) \quad\text{and}\quad (0,1) \\
(1,0) \quad\text{and}\quad (1,0) \\
(1,1) \quad\text{and}\quad (1,1),
\end{gather*}
and each line is sent with probability $1/4$. In each line, the first pair is the one sent to Alice and the second one sent to Bob, and the first bit of the par encodes the result of a measurement in the $Z$ basis, and the second in the $X$ basis.
In general, if some correlation satisfies all the Bell inequalities in a given scenario, then it has a local hidden variable model, and there's an algorithm to construct it. Conversely, if you can find a local hidden variable model for a correlation that proves that it satisfies all the Bell inequalities for the scenario.