Basically what you do is, you have all your game objects positioned using a custom coordinate system.
Then you can lets say create 2 objects, both 1*1 units, even if the first one is 10*10 pixels and the second 256*256. All you need to do is scale them. Though you probably will want the same precision on all objects.
Now, with your custom coordinate system, you can say that 1 unit = 1 screen height. So if you have a 256*256 sprite, and you have it 1*1 units in your game coordinates, it will always be scaled to be 1 screen height regardless of how many pixels the screen has. Same with position (eg. 0.333 will always be 1 third of the screen)
On different aspect ratios you will have different amount of objects visible because 1 screen shows more of your world on the X axis than another (unless you use a black border of some type, or decide that 1 unit=1 screen width, so bigger aspect ratio would show LESS of the world on Y axis)
Of course, what this means that if you have your 16*16 sprite, it will not be 16*16 pixels, which might produce visual artifacts. You may try to avoid that by scaling so that its always some multiple of the real size (so 1 unit= some multiple of lets say 16 pixels, so 16, 32, 48, 64...) and choose the best scaling for the screen (so it always shows approximately the right amount of the world, sometimes less sometimes more)
For GUIs you might want something different, because you might not want them to be the same scale on all screens. A GUI might might look ok on a 800*600 screen might look blurry and hard to read on a 1920*1080 screen. What ive seen often used is a system where the positions and sizes are combinations of (Unit, Pixel offset) so (0.5,100) would be "100 pixels from the center". The values can be negative so you can start the count from either side of the screen.