Using the concept of hybridization it can be explained.
Shortcut formula to find hybridization(let X) is-
X=SA +1/2 * (G-V+/- a)
here, SA=surrounding atoms
G=ground state valency of central atom
V=valency of central atom in given species
+/-a=charge on given species
If X=2 --> sp hybridised
X=3 --> sp² hybridised
X=4 --> sp³ hybridised
X=5 --> sp³d hybridised
and so on....
Using this formula,
BeCl2 is sp hybridised, so it has linear geometry
and SCl2 is sp³ hybridised, so it has tetrahedron geometry, having angle 109.5°!