How to Delete Cart price rules by id Magento 2?

Cart Price used to give a discount to the customer of the site and If the Cart price rule is expired in the system, You can delete it by Sales rule id.

Required interface to delete cart price rule,

Use deleteById() function to Delete rule by ID.

namespace Jesadiya\DeleteRule\Model;

use Exception;
use Psr\Log\LoggerInterface;
use Magento\SalesRule\Api\RuleRepositoryInterface;

class DeleteRule
     * @var LoggerInterface
    private $logger;

     * @var RuleRepositoryInterface
    protected $ruleRepository;

    public function __construct(
        LoggerInterface $logger,
        RuleRepositoryInterface $ruleRepository
    ) {
        $this->logger = $logger;
        $this->ruleRepository = $ruleRepository;

     * Delete Sales rule by id
     * @return bool
    public function deleteRuleById($ruleId): bool
        $salesRule = false;
        try {
            $salesRule = $this->ruleRepository->deleteById($ruleId);
        } catch (Exception $exception) {

        return $salesRule;

You can get the data of sales rule by id,
$ruleId = 1;
$salesRuledata = $this->deleteRuleById($ruleId);