Cut your fingers off. However, this procedure has been know not to be very fun. So therefore, I would recommend wearing a rubber band on your wrist. And every time you catch yourself doing it, or someones else does, pull back on the rubber band so that it snaps you hard. This is a standard thing done to get over bad little habits like cracking your knuckles.
Find ways to get your mind off of it. Do other productive things. That's what I've been doing and just realized that I've been slowing down on cracking my knuckles. And right now I am getting the urge to crack my knuckles.....back to stirring my pasta sauce!