This is from the Brazilian writer, Fernando Sabino:
“Tudo no fim dá certo. Se não deu, é porque ainda não chegou ao fim.”
“Everything works out in the end. If it doesn’t, it’s because it hasn’t reached the end yet.”
You could probably apply this to writing as well…