Legal fees related to seeking a refund of individual income taxes normally would be deductible as a miscellaneous itemized deduction subject to the 2%-of-adjusted-gross-income floor. However, this deduction is suspended for 2018 through 2025. Win or lose, legal fees related to business taxes (but not personal taxes on business income) may be a deductible business expense.
A distribution of your investment that is not subject to tax unless the distribution exceeds your investment.