If someone’s in a happily committed relationship, leave them alone. Don’t come around telling them “I know I shouldn’t tell you this because you have a girlfriend, but….” If you know you shouldn’t be saying it, then don’t. How selfish is it to sit there and try to sabotage someone you supposedly care about’s relationship?
If you care about that person or still love them, then keep it to yourself until they are no longer in that relationship, and if they don’t get out of that relationship then you two weren’t meant to be so it’s time to move on.
If you care about someone, let them be happy, even if it’s not with you.