'But for' is a formal alternative to 'if it weren't for' or 'if it hadn't been for', commonly used in written English to express that one thing was essential for another outcome.
Practice tip: Think of 'But for X' as 'X saved the situation'. But for your help = Your help saved me from being lost.