To get into the Ravenclaw dormitory, they need to answer a riddle. What if they don’t know the answer? How will they get in?
You wait for somebody else to show up.
When Harry first encounters the eagle, Luna explains what happens if you get the question wrong. If you don’t know the answer, you wait for somebody else who does. Same as all the other dormitories, except (this being Ravenclaw) there’s a vague hope that you’ll learn something by doing so:
According to the Pottermore welcome letter for Ravenclaw, it’s not unusual to find people stumped by the riddle, waiting for somebody to come along and help them out:
Note the phrase “the day’s question”. It sounds as if the raven changes the riddle once a day, which sounds about right. Most people will leave Ravenclaw Tower at least once a day, and so get the benefit of the day’s riddle, it won’t stagnate because everybody already knows it, and it’s not changing enough to be too annoying.
(And having said that, @chirlu points out in a comment that this is directly contradicted by the encounter in Deathly Hallows.)