Since you know you have 16 erasers and 24 pencils, the first thing you should do is put it in to an actual ratio, like so:
16:24
Now that you have a ratio, you need to simplify it. It is very similar to simplifying fractions. You can start by dividing by 2, which gives you:
8:12
And by two again:
4:6
And again:
2:3
So you now know that Gregory’s ratio of erasers to pencils in his locker is 2:3!!
You could also divide 16:24 by 8 which gives you the answer quicker, but I find it easier to break it down in smaller, more manageable chunks. It’s all in finding a common multiple and making the ratio the smallest whole numbers possible :)