Depends on what doesn't work means ... Does it not work because you dropped it in lake Pleasant? The battery is old? The screen is shattered? What model is it? iPhone X or iPhone 5? Count on paying. You may be pleasantly surprised .... But i doubt it. Nowhere near enough information to give an answer.
I guess if it is still under warranty
Thanks! Your answer is awaiting moderation.