Hand pain

I somehow hurt my hand and one of my fingers is painful to move, it’s not swollen but hurts, what’s the best way to take care of it? Ice or heat