Whats the difference between anesthesia and analgesia?

Pain relief. Analgesia is the relief of pain, you may or may not need to be under anesthesia for that. Anesthesia implies either unconsciousness (general anesthesia) or complete absence of sensation (regional anesthesia). Analgesia can take a variety of forms including pain medications, local anethesia or regional block.
Anesthesia/analgesia. Analgesia means without pain (an + algos). Anesthesia means without sensation (an + asthesis). As such, an analgesic medication provides relief from pain. An anesthetic medication will remove all sensation, including pain, temperature, and touch.
Uncontious vs pain. Analgesia is about the relief of pain analgesia is about the relief of pain, amnesia(usually by unconsciousness) and blocking the stress response to surgery (relax the muscles, blunt heart and endcrine response, support the kidneys, protect the brain). Anesthesia is a greek word meaning "a strange sleep - strange because no sense of time exists.
Effects. Anesthesia means lack of feeling, while analgesia means lack of pain. In the first, anesthesia, you will be asleep, but in the second you will be awake. I hope this answers your question.