Phone basics
You have every right to block a number that bothers you, and here is the comforting part: the blocked caller is never told. Their calls just quietly go to voicemail, and their texts never arrive.
On iPhone: open the Phone app, tap Recents, find the number, tap the little i in a circle next to it, scroll down, and tap Block this Caller. For a bothersome text: open the conversation, tap the name or number at the top, tap Info, then Block this Caller. On Android: open the Phone app, tap Recents, tap the number, then tap Block or Block/report spam. In texts, open the conversation, tap the three dots in the corner, and choose Block. Changed your mind later? iPhone keeps the list under Settings, Apps, Phone, Blocked Contacts.