Maybe: There is a solution for every problem. Keep looking until you find the solution but , if there is none, then forget about looking for one (or perhaps, change your atttitude toward the problem) The final word, ''it," could refer to either the problem or the solution, so the last phrase is not clear.