I had a bubion surgery. Now I have pain in the ball of my foot. What can be its cause? What can I do to prevent orease the pain?

Capsulitis. Most bunion surgeries involve an osteotomy(surgical cut through the bone) to realign the toe. A shortening of the first metatarsal occurs because of this cut. This will cause increased stress being placed on the second metatarsal. This can lead to inflammation and pain. Usually this will resolve over time as the second metatarsal adapts to this increased stress. Good shoes and supports help. Dr l.
Transfer of pressure. You may be getting transfer of pressures following the bunion surgery. Have it evaluated by your surgeon and get the appropriate treatment.
I do not understands. Are you saying that you had bunion surgery and now have pain on the ball of the foot? There are many reasons that you could have pain on the ball of the foot following bunion surgery. It depends on the type of procedure that was performed, how long it has been since surgery, and your level of activity following surgery. Post operative complications could also contribute to pain.
Surgery. Transfer pain can occur after bunion surgery. It may resolve spontaneously , but since you didn't state when you had surgery your best choice is to see your surgeon for assistance.