According to dual nature of light, it is said to have both particle as well as wave nature. When we think of it as a wave, its momentum can be found out from De Broglie's equation i.e λ = h/mv, provided we know its wavelength. But how do we calculate the momentum of a photon when we think of it as a particle?
From relativity, we know that the energy-momentum relation is given by:
$$ E^2 = (pc)^2 + (mc^2)^2 $$
We can see that when $m\rightarrow0$, $E = pc$. The energy of the photon can be found using $E=hf$ and you can solve for $p$.