Knowing four sides is not sufficient. Imagine four sticks held together with pins. You can flex that so that the diagonals are many different lengths even though the lengths of the sides is constant. You need to know the angles. For a rectangle, of course, you can use the Pythagorean theorem. For a general quadrilateral, even for a parallelogram, you need to know the angles as well.
If the two sides have lengths \(\displaystyle s_1\) and \(\displaystyle s_2\) and the angle between them is \(\displaystyle \theta\), you can use the "cosine law": the length of the diagonal opposite that angle is given by \(\displaystyle d^2= s_1^2+ s_2^2- 2s_1s_2cos(\theta)\).