Contrastive learning vs. pretext tasks

I am new to these concepts. I know we use contrastive learning in the context of selfsupervised/unsupervised setting. But I am wondering what is the relation between them?

Thanks in advance