Collaboration Diagrams (communication)

I have a big project on software engineering and I have to do some communication diagrams. The only thing I dont know how to draw the if then statements. Can someone help?

I searched on Youtube but the people explaining the diagrams only used simple examples without if then statements