<input type="checkbox" class="category" data-category="2" />
<!-- News Block -->
<div>
<button type="button" class="newsBlockCategory2">Category #2</button>
</div>
<!-- News Block -->
<script>
$(".category").click(function() {
let categoryId = $(this).attr("data-category");
$(".newsBlockCategory" + categoryId).click();
});
</script>