Rounded line

I want to make rounded line like that.

How to round line edges and edges where line bends?

Any idea?