"He was very good to/with me when I was ill. "
Which preposition I should use above?
Please comment.

Usually, very good to me.
He was good to me and did all the things I found difficult.

However, with is possible and is used to mean ‘he handled me well.’
I was grumpy when I was ill, but he was good with me and always stayed calm.