xìngkuī幸亏 is used when the negative consequence is avoided with the help of others of the occurrence of the some factors. It is frequently used when expressing a mood of feeling fortunate/lucky. For example,
他受伤了,幸亏不严重
tā shòushāngle, xìngkuī bù yánzhòng
He be wounded fortunately not serious
‘He is wounded, fortunately it is not serious.’