Express that there is no other choice/alternative; 'have no choice but', 'nothing but', 'cannot do anything but'.
Verb-Te form + よりほかない, い-Adjective-Te form(+の) + よりほかない, な-Adjective + で + よりほかない, Noun + で + よりほかない
Long explanation:
The ~よりほかない grammar point is used to express that there is no other choice or alternative in a given situation. It can be translated as 'have no choice but', 'nothing but', or 'cannot do anything but' in English. The formation differs depending on whether it is used with a verb, い-adjective, な-adjective, or noun.