Confronting someone being cold randomly

If someone is being cold out of the blue, for no reason, is it a good idea to ask them what is up? Its not a very close relationship, but why are they randomly being cold?

How can i deal with this?

It does bother me because they’re only cold with me and not anyone around me? I dont get it…