what is the difference of sequece of index in MySQL I am now using this command to select in MySQL 5.7:
SELECT game_id
        FROM platform_reward_record
        WHERE hub_sync = 0
        GROUP BY game_id
        LIMIT 100

when I create index like this:
ALTER TABLE `packet_db`.`platform_reward_record` 
ADD INDEX `idx_hubsync_gameid` (`game_id`, `hub_sync`);

the query is very slow, but using this index:
ALTER TABLE `packet_db`.`platform_reward_record` 
ADD INDEX `idx_hubsync_gameid` (`hub_sync`, `game_id`);

it is fast, why the field sequence affected whe slect speed? What should I learn from it?
Think of an index as an ordered data structure. Technically it's more than that, but when it comes to query optimisation, usually this is all you need to know.
To explain why this matters in your case, I'll use a common analogy: a phonebook. A phonebook is a dataset ordered by (surname, name), so it's actually an index made of paper.
Because it's ordered, looking for Tom Baker is reasonably fast. Finding all Bakers would also be reasonably fast (unless they're thousands... but that's because you're a human, not a machine). Finding all Toms would be impossible. Or better said, it's possible, but you have to scan ALL entries from the beginning to the end. It's slow, it's like not using an index at all. If the index were ordered by (name, surname), you could find all the Toms but not all the Bakers, and you'd still be able to find Tom Baker.
So now you should understand why, in general, the order of columns of an index matters. But let's see why it matters in your case.
You want to restrict your search to a certain hub_sync, and then group the rows by game_id. In this order! The opposite wouldn't work: once you grouped the rows you lose the hub_sync information.
So first you apply the WHERE, and you need to use the first row of the index for that (remember: you can quickly find the Bakers, not the Toms). Then you can group the rows by the second row of the index.
As a side note, you can use DISTINCT instead of GROUP BY. It's not faster, but it makes it more clear what you want to achieve.