Foam safe

Sydney
Help!
I've used the pill before and gave me heart problems so I stopped. Today me and my BF used the foam. Has anyone else used foam before?? Is it safe or should I get a pill?