While they can both convey a sense of yearning, the two words are pretty different in meaning despite the similarity in sound.
The main meaning of 憧れる is to "admire". So when used with regard to a person, it's usually some kind of idol who the speaker looks up to and perhaps wants to become like themselves. When used of an activity or career, it usually indicates that the speaker has a strong interest in doing that thing, looks up to people who do it, and would like to do it themselves someday. So that's where the sense of "yearning" can come in - the powerful desire to do that thing or become like that person.
焦がれる, on the other hand, is about passion. It's usually used in a romantic context, to indicate a sense of yearning for someone so strongly that it's painful (hence why it's derived from 焦げる, to burn), and is commonly paired with 恋 as the expression 恋に焦がれる or the compound verb 恋焦がれる. It can also be paired with other, non-romantic actions (待ち焦がれる, 思い焦がれる etc), in which case it represents a similar passionate sense of being so utterly preoccupied by this action that you can't think of anything else right now.
There is some overlap between the two words - when used on its own with an object other than a person, 焦がれる can take on a meaning that's quite similar to 憧れる, indicating something that you're passionate about and long to do. For instance, 女優に焦がれる and 女優に憧れる can be roughly interchangeable, both indicating a longing to become an actress (though the 憧れる version sounds like a more "pure" and well-intentioned longing whilst the 焦がれる sounds more intense and overwhelming). However, this is a relatively rare usage of 焦がれる.
There's also a bit of overlap on the romantic side - 憧れる is sometimes used with romantic implications, indicating idolising someone in a romantic way, and 憧れの人 can even be treated as equivalent to 好きな人 in some contexts. But again, it's not the primary meaning of the word, and when it's used in this way it indicates a specific type of pure, admiring romantic feeling, as opposed to 焦がれる which is a stronger and more overwhelming passion.