In music you have a time signature, which is the number of beats in a bar
The time signature for most music and certainly most popular music is 4/4, theres 4 beats in each bar
Listen to Stuck on a puzzle by alex turner, a very clear 4 beat repeating riff on drums
Then you can have 3/4 which is 3 beats per bar, for example Sing It again by Beck
But to actually count, drums/percussion is a good place to start, or try to tap your foot to the regular beat and count how many you do in a repeating rhythm
to be honest it will come with practice and getting an ear for it