A high melting point and hardness of a material indicates that the bonds between molecules that make up the material are quite strong.
A strong bond between molecules means that the bonds are much harder to break apart compared to weak bonds.
A hard material is hard because the bonds offer a lot of resistance when you try to deform the material, whereas the bonds between molecules in a soft material are easier to break apart offering less resistance to deformation.
The same can be said about melting a material. Essentially, the stronger the bond the more resistance the bonds between molecules provide against deformation.