Use the capture function in order to have the best shot at getting your rarest heroes. Rare and legendary heroes will pop up far more often in battle than in the store, so make use of capture. Wait until the health bar glows white (which means extremely low health). Even then, the capture chance will usually be 5% to 10%, so be ready to attempt a LOT of captures for the real good heroes.
Even then, make sure to bring a cleric type of hero with you when you are going out trying to capture tougher heroes. They can heal your other heroes, so you save money on healing items. And if you are going back to an older stage and you already have extremely highly leveled heroes, take at least one lower level hero with you so that you don’t end up depleting all of their health in one shot by accident.
If you have a lot of diamonds, use them for elite summonings in order to get the best shot at a free legendary or epic hero. Another way to get elite summonings (and silver runes, while you’re at it) is to go to the Arena mode, keep on winning and continue ranking up and earning rewards. The higher the ranks that you earn, the better the prizes.
Look for both event dungeons to pop up, and for extremely advanced dungeons such as the Caverns of Illusion, and for any dungeon where you can go up against a legendary hero. Even if you are not on a capture mission, these dungeons will tend to have rarer treasures, as well as larger coin rewards.
Do all of the research that you can, and not just the main research. Some of the most valuable research is the artifact research, which can earn unheard of bonuses, as well as elite summonings and silver runes. Any time that you get to do “strange artifact” research, do that too, for HUGE rewards.