The block goes from some speed
to zero in the space of 4.0m. The only net force on it during this time is friction. By finding the work done by friction, we will know how much energy the block had just after being struck by the bullet.
Now we know that the system had 6.08J of energy just as it started to move. We now can find the initial velocity of the block just after being struck by the bullet using the definition of kinetic energy.
Since momentum is conserved, we find the momentum of the system block-bullet just after collision and then equate that to momentum of the bullet just before collision.