The order that categories are displayed in a categorized symbol cannot be directly and easily sorted by a separate "index item". Here are a couple of workarounds that I think will each do part of what you want to achieve.
Method one: manually re-arrange the items in the legend.
In the layer styling panel, drag and drop the legend items into the desired order. If you have many tens or hundreds of categories, this method will take a long time. Use the next method instead.
Method two: concatenate the index field with the category field.
Add an "index" field to the attribute table, where the index values represent the sort order for the categories. Using the geologic ages in the order you provided them (Quaternary = 1, Paleocene = 2, Eocene = 3), use the field calculator to assign the correct index value to every feature with this expression:
case when "age" = 'Quaternary' then 1
when "age" = 'Paleocene' then 2
when "age" = 'Eocene' then 3
Set up a categorized style as usual, but instead of selecting the "age" field from the Column menu, enter this expression:
The categories will be
Because the index value comes first, the categories are automatically sorted by the index value.
If you want the legend to show only the geologic age without the index number, edit the legend value.
Note that you don't have to use an underscore in the concatenate expression. For manually editing the display values, it might be more convenient if the index and age were separated by a space instead of an underscore, like this:
concat("index",' ',"age"), or without any character separating them, like this: