Trouble with poop

Recently, I encountered an issue with my toddler’s bathroom habits, and it’s becoming a concern. My little one is refusing to poop in the toilet and instead uses their pants. I’ve tried encouraging them, but it’s not working. Any advice or tips?