Rebuilding trust is crucial. You can't expect her to jump back into a relationship right away. So, be honest and reliable. Share your feelings openly but also respect her feelings and boundaries. It's a long process but if you do these things right, there's a good chance of getting back together.
One key element is sincere apology. You have to admit your mistakes clearly. Another is self - improvement. If you become a better version of yourself, it's more attractive. For example, if you were lazy before, start being more active and responsible.
Patience is really important. You can't rush things. In success stories, the guys often take their time. Also, understanding her needs. Maybe she needed more attention before but you didn't give it. Now you need to figure that out and meet those needs.