The two triangles are simillar due to AAA theorem. This means that equivalent sides of the triangles are proportional, which means that we can create a relationship between them.
We were given the measurements for sides BD and EF. We were also told that BD is twice the length of ED, therefore we have:
[tex]\begin{gathered} \frac{BC}{EF}=\frac{BD}{ED} \\ \frac{2\cdot ED}{4}=\frac{8}{ED} \\ ED^2=2\cdot8 \\ ED^2=16 \\ ED=\sqrt[]{16} \\ ED=4 \end{gathered}[/tex]The length of ED is equal to 4.