These sound near-identical in ordinary speech, but they cannot occupy the same slot in a sentence: one is a verb, the other an adjective. That makes the test easier than it looks. If the word is doing something, it is "elicit." If it is describing something, it is "illicit."
A verb. To draw out a response, reaction, or piece of information.
An adjective. Forbidden by law, rules, or custom.
Elicit and illicit sound almost the same, especially in quick speech, but they are different parts of speech with unrelated meanings.
Elicit is a verb meaning to draw something out, usually a response, a reaction or information: the question elicited a laugh, the survey elicited honest answers. Illicit is an adjective meaning illegal or forbidden: illicit drugs, an illicit affair, illicit trade.
The first letters are a useful check. Elicit starts with e, like extract, which is what it does. Illicit starts with ill, like illegal. If the word describes something forbidden, it is illicit. If someone is getting a response out of someone else, it is elicit.
The questions were designed to illicit honest feedback.
✓The questions were designed to elicit honest feedback.
Drawing out a response is the verb elicit.
Police seized a shipment of elicit goods.
✓Police seized a shipment of illicit goods.
Illegal goods are illicit, with ill as in illegal.
His joke failed to illicit a single smile.
✓His joke failed to elicit a single smile.
Getting a reaction out of people is elicit.
Quick way to remember
Ask whether the word is an action or a description. Actions take "elicit," which starts like "extract" — both draw something out. Descriptions take "illicit," which starts like "illegal."
How is it different from solicit?
Solicit means to ask for something directly, such as donations, bids or business. Elicit means to draw out a response, often indirectly.
Are they pronounced differently?
In careful speech elicit often begins with an "ee" or "eh" sound and illicit with an "ih" sound. In quick speech they usually sound the same, which is why spelling is the only safe guide.