Do you mean in the release pipeline? You can set your pre-deployment approvals on your release pipelines using gates or an approval from a user.

Configuration of pre-deployment approvals.

If you mean deployment approvals on the build pipeline, you could configure a logic for the build run (specific branch, conditions to evaluate variables and booleans before the run)
As stated in the documentation:
Approvals and other checks are not defined in the yaml file. Users
modifying the pipeline yaml file cannot modify the checks performed
before start of a stage. Administrators of resources manage checks
using the web interface of Azure Pipelines.
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass