You've probably seen a metronome before. There are old ones with a pendulum that swings from side to side and new digital ones that beep. But all of these devices are designed to help you establish a regular and steady beat.
Sometimes musicians find it useful to practice their playing along with a metronome to make sure that they aren't rushing ahead or lagging behind the beat.
After lots of practice musicians tend to develop their own internal sense of time and beat which keeps their playing in time.