When you block somebody online, it stops them from being able to contact you. You will no longer see messages from them and can stop somebody harassing you for images or bullying you.
Source: Sexting | Online and Mobile Safety @ ChildLine
image by HebiFot under CC0 license