This is explained by Photo-electric effect. Einstein won the Nobel Prize for this.
According to Photo-electric effect, a photon with frequency greater than the threshold frequency(which is element specific) can knock off an electron out of its place.
The maximum Kinetic Energy will be K.E = hv - hvo$K.E = hv - hv_o$ where v$v$ is frequency of incident photon and vo$v_o$ is the threshold frequency. h$h$ is plank's constant. hvo$hv_o$ is also called work function of the particular element.
The value of work function or threshold frequency of the element decides which incident photon frequency will knock the electrons out.
This increases when we move from metals to non metals.
About increasing the frequency, there are lab tools available to do it.