Yes, both sentences are grammatically correct. The difference between "learnt" and "learned" primarily lies in regional usage; "learnt" is mainly used in British English, while "learned" is more common in American English.
Meaning: The speaker is expressing that they feel okay about a situation or condition (indicated by "It's cool") and that they have accepted it or adapted to it over time ("I’ve learnt/learned to live with it").
Rephrased: