Cookie Run: Kingdom Rainbow Cubes
Rainbow Cubes are used in the Gacha to obtain costumes for your Cookies. These costumes have no special effects besides just changing how your Cookie appears when used. This adds a fun, optional, cosmetic system to the game so you can add more uniqueness to your team.
Getting Rainbow Cubes isn't necessarily the most obvious thing in the world. You may have pushed through multiple chapters of the campaign and several event missions while still having received no cubes whatsoever. This is an understandable struggle and it makes sense why you may not know how to actually get this currency.
Unforunately, there's aren't many ways to obtain Rainbow Cubes. The main method of getting them is to spend real money in the Shop on deals that occasionally pop up. There are also occasional event rewards that will give you some, though they don't appear to be super common. If you were playing during Halloween, there was an event building you were able to get that produces some every 12 hours, but that is not currently in the game to obtain anymore.
Your focus for trying to get Rainbow Cubes naturally will be to focus on the Guild Alliance once you unlock it and to exchange points in the Mileage Shop. The Guild Alliance will mostly be end-of-season rewards, both for personal ranking and guild ranking, while the Mileage points are just obtained from doing draws in the Gacha.