Trouble breast feeding

Daisy.
My baby was born Monday morning & I've been having a difficult time breast feeding bc he's not latching on properly. My breasts are in so much pain during & after feeding. They are cracked so badly that I had to stop breast feeding yesterday & bought formula. I bought a pump bc I don't want to exclusively give my baby formula. I was planning on breast feeding only. I feel like I'm failing as a mom. Can anyone give me any tips? How can I produce more milk for my baby? How can I start breast feeding again?