In CSOM PowerShell, it would look something as mentioned in below code. Modify it as per your list and group names :
$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName,$password)
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$Ctx.Credentials = $SPOCredentials
$web = $Ctx.Web
#load the groups
$groups = $web.SiteGroups
$Ctx.Load($groups)
$Ctx.ExecuteQuery()
# get the SharePoint group
$Group = $groups.GetByName("<Your Visitor Group Name>");
$Ctx.Load($Group);
$Ctx.ExecuteQuery()
$listName = $Ctx.web.Lists.GetByTitle("Custom List")
$Ctx.Load($listName)
$Ctx.ExecuteQuery()
# break inheritance
$listName.BreakRoleInheritance($true, $false)
$Ctx.ExecuteQuery()
# load the list role assignments
$Ctx.Load($listName.RoleAssignments)
$Ctx.ExecuteQuery()
# remove the visitor group from the list
$listName.RoleAssignments.Groups.Remove($Group)
$Ctx.ExecuteQuery()