ㄹ/을 위해 vs (으)려고
Hello!
I've heard (으)려고 is a more commonly used grammar used to express '을 위해', which translates to 'for' or 'in order to do something' in English. Is this correct thinking? I've attempted the examples below to try and understand more, and I am wondering what the differences are?
감기 회복을 하려고 약을 먹었어요
감기 회복을 위한 약을 먹었어요
Hopefully I'm making sense! Thank you! ^^