Thank you for putting up with me. 
こんな私と一緒にいてくれてありがとう。

How can you put up with him? 
何であんな彼と一緒にいられるの?



Put up with = tolerate 
耐える、我慢する