There are many things you can take. You can use any over the counter stool softener. Miralax, Senokot-S, there are many. Drink plenty of water and stop your narcotic pain medication as soon as possible. You can try enemas or suppositories if needed. Talk to your surgeon.
The best treatment for constipation after surgery is to ambulate frequently, utilize a stool softener, and wean off of the pain medication as quickly/safely as possible. Also staying well hydrated is of good benefit.