It is indeed tricky that the spanish language has two words that both mean 'for'. Nevertheless, it can be done to distinguish between them.
Firstly, Por has more meanings than Para so, if in hesitation, opt for Por. & if you want to say 'in order to' do something or other, generally use Para.
Por suggests: in exchange for, on account of, because of, for the sake of, on behalf associated with, for (time), in quest of, per, during, in, by means of, along, & by.
Para implies: purpose (so as to), destination, intended for, till, only to, & with too... to.
See these examples:
POR
Gana cien euros por d??a (the affected individual earns 100 euros per (some sort of) day)
Fue por el m?dico (the individual went for (in search of) your physician)
Trabaj? all?? por seis meses (I worked there for (time) a few months)
Duermen por la noche (they sleep during the night time)
PARA
Se levanta a las ocho para ir al mercado (he or she gets up at eight (in order to) go to the sector)
Salgo ma?ana par Los Estados Unidos (I'm departing tomorrow for (destination) the States)
Este regalo es para mi madre (this present is for (intended for) my mother)
Soy demasiado viejo para trabajar (My business is too old to work)
Both the prepositions Por and Para are used in different idioms (expression or phrases), as within:
Por los siglos de los siglos suggests 'for ever and ever'.
Para siempre means 'forever'.
Needless to say, there are a great a large number of more subtle and rather intriguing instances when Por is chosen across Para, or vice versa. In-depth study of speaking spanish will make these clearer over time. Alternatively, take Spanish lessons with an skilled tutor to allow you out along the way.