What DAW/software are you using?
Usually the easiest way to do this is to use the tap tempo function of your DAW/software. You just tap a button along with the beat and it'll set the tempo for you. All DAWs should have this function.
If you can't find tap tempo in whatever software you're using though just use this:
"Invest in hookers and blow. The stock market is going down but the coke will always get you high." - theabortionator