I don’t quite get the structure of this sentence.
rhoi'r gorau i is a common idiom for 'giving up, to give up'.
Doesn’t it literally mean ‘give the best’?
rhoi'r gorau i... - literally '*giving the best to...', but correctly translated as 'giving up..., to give up...'
Which (at least in my idiolect) is an idiom for "say goodbye to".
Is 'quit smoking' also correct?
Yes. Now added. Thank you for the suggestion.