You can use Visualforce to accept a list of ID values, which you can then act upon. At a basic level, your page looks like this:
<apex:page standardController="someSobjectType"
recordSetVar="records"
extensions="ApexClassToUse"
action="{!actionMethod}" />
And in your class, you need a StandardSetController constructor to get the information you want:
public with sharing class ApexClassToUse {
sobject[] selectedRecords;
public ApexClassToUse(ApexPages.StandardSetController controller) {
selectedRecords = controller.getSelected();
}
public void actionMethod() {
// The selectedRecords list contains the records that were checked
}
}
With the page and Apex code in place, you can then create a custom list button that uses a Visualforce page. This feature works both in Classic and Lightning.