A repair (fixing a leak, patching drywall) is deducted in full the year you pay for it. An improvement (a new roof, a remodeled kitchen) has to be capitalized and depreciated over years instead. Getting this wrong is one of the most common landlord tax mistakes.
Rental losses are generally treated as "passive" and can only offset passive income, with a limited exception (up to $25,000) for landlords who actively participate and meet income limits. This is a complex area, a CPA who works with landlords is worth the fee here.
This is general information, not tax advice, talk to a CPA about your specific situation, especially around depreciation and passive loss rules.