More often than not affect is used as a transitive verb (pertaining to a specified object) and effect is used as a noun.
COMMON APPLICATION OF EFFECT/AFFECT
The definition of effect usually used is in relation to a cause a result of becoming operative a degree of success or an impression. For example:
The efficiency of the computational algorithm had a significant effect on the amount of time and memory required to perform the calculations.
Here effect was a noun. The cause was the efficiency of the algorithm. The degree of success was significant because it made an impression upon the observer’s mind that the calculations took so much less time.
The definition of affect usually is something like to have an effect on something. For example:
The efficiency with which the computational algorithm was written greatly affected the amount of time and memory required to perform the calculations.
Here affect was a transitive verb. The efficiency of how the algorithm was written in effect affected how quickly it finished.
THE CONFUSING SCENARIO
However there comes an ambiguous case since we have two very similar verb definitions for effect and affect according to Oxford English Dictionary:
In these cases notice how effect tends to be more indirect as a verb and affect tends to be more direct as a verb. For instance:
This is beginning to affect how the law determines which of these relationships should be given legal recognition.
This directly affects the [words of the] law an object. This is stated outright.
He even stated that he need not name every disease or body part that God’s power was effecting a multitude of cures all over the arena.
God’s power effected or brought about a multitude of cures to many objects. Which objects? They were not specified so the exact targets of the effect are open to interpretation.