A typical light electrical box will not safely support a ceiling fan. You need to get above it in the attic and reinforce it with a block of 2x4. If no attic access, it gets more complicated because fan mount kits would replace the light electrical box.
Once that is taken care of, connect the blue and black fan wires to the black wire in the box (use wire nuts), and the white wires get connected together. Hopefully there is a bare ground wire in the electrical box; fasten the fan green wire to it. Otherwise fasten the fan green wire around one of the mounting screws.