If you want to see a dumb example of how you can implement indexing on top of a SQL database without it, I wrote a tutorial on implementing basic indexes [0] as part of a series on making a SQL database from scratch.
And of course, Use the Index Luke is a great reference for the real world.
[0] https://notes.eatonphil.com/database-basics-indexes.html