To block a number on your iPhone, open the Phone app, go to "Recents," find the number you want to block, and tap the "i" icon next to it. Scroll down and tap "Block this Caller" and then "Block Contact" to confirm. This will prevent the blocked number from calling, sending texts, or using FaceTime with you.
To block a number on Android, you can do so through the Phone app or the Contacts app. In the Phone app, go to the Recents tab, find the number you want to block, long-press it, and select "Block / Report Spam". Alternatively, in the Contacts app, find the contact, long-press the phone number, and select "Block number".