In a band, bass and drums together are "the rhythm section." Specifically, the bass and the kick drum (the big floor drum, "kick") should land at exactly the same time. When they do, the music has foundation. When they don't, it sounds slippery.
Listen first
Put on any pop/rock track you like. Close your eyes. Try to hear just the kick drum. Once you have it, try to hear the bass. Notice: most of the time, the bass hits the same moment as the kick.
Exceptions are intentional, the bass might hold a long note while the kick patterns underneath, or the bass might play a melodic fill between kicks. But the foundation of the song is bass + kick together.
Practice with a click
A metronome is your stand-in drummer. 80 BPM. Play a root note on every beat. Every single click should have a bass note on top of it. If your note arrives 50 milliseconds late, you can hear it; the music feels "rushed."
Practice with a backing track
YouTube has thousands of free "drum-only backing tracks." Search for "[your tempo] BPM drum loop" or "drum backing track rock." Play roots over the drums. You'll hear the kick drum and the snare; your job is to play with the kick.
The "in the pocket" feeling
When the bass and drums are tight, players say the rhythm is "in the pocket." It's a feeling, not a measurement. The notes line up, the energy locks, the listener nods their head whether they want to or not.
Aim for this. It takes years. Start now.
90 BPM. Two minutes of just roots. Each pluck on the click. Listen for the lock.
Next: your first real bass line. Seven Nation Army.