Record page buttons and actions: page layout versus Dynamic Actions
Key Takeaway
Page layouts can't show an action only when a condition is met. To show a button only when a record field has a certain value, upgrade the record page's Highlights Panel to Dynamic Actions in Lightning App Builder. Then add a visibility filter on that field to the button.
In Lightning Experience, the buttons and actions on a record page come from one of two places. By default, they come from the object's page layout. With Dynamic Actions, you set them in Lightning App Builder for one Lightning record page instead. Dynamic Actions also let you add filters, so each action shows only when and where it is relevant.
Buttons are actions
In Lightning Experience, standard buttons and custom buttons are treated as actions, just like quick actions. So a question about putting a button on a record page is really a question about where that page gets its actions.
A custom button, such as one that launches a flow by URL, can go on a Lightning record page through the page layout or through Dynamic Actions. Custom buttons that call JavaScript aren't supported in Lightning Experience, so they don't work on a Lightning record page.