How can I add custom less file and in a particular theme compile less file in Magento 2

Just add new file here

app\design\frontend\Vendor\Themename\web\css\source\_new.less

and import this file in source file given path below

app\design\frontend\Vendor\Themename\web\css\source\_sources.less

import your file

(if there is not available _source.less file in your theme then go to vendor\magento\theme-frontend-blank\web\css\source folder and copy file in your custom theme)

@import '_new.less';
  1. clear cache
  2. php bin/magento setup:static-content:deploy