On most Android devices, text and call blocking features are built into the device. Please see below for the steps, your device might look different due to the software version, but the steps would be similar.
How to Block Text Message
Step 1: Go into your text message inbox, pull up the text messages conversation with the number you wish to block, select More at the top right-hand corner.
Step 2: Select Block number
Step 3: Toggle on Message block, Call block, or both, then click OK.
After numbers are added, you can manage numbers you have blocked, to learn how to click HERE.
How to Block Calls
The above method works for blocking calls. The method below shows how from within the phone app.
Step 1:From your call log, select the number you wish to block, tap More.
Step 2: Select Block/unlock number
Step 3: Select Call block, Message block, or both.