Atoms stick together because they form covalent bonds AND because they form ionic bonds. These are just different arrangements whereby atoms share their outer electrons to make a more stable arrangement. We learned to refine pure elements because it was a necessary part of winning wars. Once they discovered how to melt blue stones to make copper - and then bronze - the Arms Race had begun. Later, they found how to extract pure iron (and then steel) from red rocks and those with iron weapons won all the battles. Iron weapons were the reason most of the forests in Europe and Britain were burned down - it was to make charcoal for smelting iron ore!!! These days, we purify all sorts of ores to extract purified metals (and non-metals) because of the commercial benefits of doing so. We use science (mainly chemistry and electrical circuits) to separate elements nowadays.
That's a lot of information to put in a few posts. You should do your own research into it, but in short. 1) Atoms have electrical charges that causes them to form bonds and attach each other. 2&3) we use many different methods to refine elements depending on what your refining. Some of those methods include distillation, electrolysis, crystallization, solvent extraction and evaporation to name a few.