やっと is an adverb that expresses the idea that something has finally happened after a long wait, much effort, or difficulty. It carries a strong sense of relief or accomplishment – the speaker feels that the result was hard-won or long-awaited.
The most common usage of やっと is to express that something desired has at last come to pass. It often pairs with past tense or ~ている forms, since the event has already been realized.
Because やっと implies a sense of waiting or struggle, it naturally conveys the speaker's positive emotion – relief, joy, or satisfaction – about the outcome. For this reason, it is generally not used with negative or undesirable results. You would not normally say やっとしっぱい失敗した ("I finally failed"), as that contradicts the positive nuance.
A secondary usage of やっと is to express that something was achieved only barely or by a narrow margin. In this case, it emphasizes how close the situation was to not succeeding.