You can block players from your friends list of from the in-game menu. Once a player has been blocked, they won't see that you are online or be able to contact you. If you are being harassed through the in-game communication, make sure to report the player to Epic Games and block them so they can't contact you.