"Purchased another home 2021 to flip" If this flip was nothing more than a one-off, then you are an investor and would have a short-term capital gain, as mentioned. However, if you wind up doing several of these flips on a somewhat regular basis, the IRS could consider the activity to be in the nature of a business (on the order of a real estate dealer), which would subject you to reporting the activity on Schedule C and potentially paying self-employment tax.
There may also be advantages to declaring your flipping activities as a business on schedule C that offset some of the disadvantages. But it has to be an "ongoing trade or business" that you carry out in a regular and businesslike way. An occasional flip is probably not an ongoing trade or business.
[My apologies for the double post. For some reason, I my formatting was lost and I can't edit or delete the original.]
You don't provide enough details.
First rule is that the two transactions are taxed completely separately. They have nothing to do with each other.
The flip is fairly simple. You have a short term capital gain, this is treated like an investment that you bought a sold, and because you held it less than 1 year, it is a short term gain which is taxed the same as ordinary income. Your cost basis is what you paid for the home plus what you paid for permanent improvements. You can't take an adjustment for repairs. Permanent improvements make the property more valuable or extend its useful life, and are more extensive than repairs, which simply maintain the property in as-is condition. Painting is usually a repair, while a new roof or floor would be an improvement. (But, if you renovate the kitchen, which is an improvement, the cost of painting as part of the renovation counts as part of the improvement.) You include the costs you actually paid for contractors and materials for the improvement, don't include any adjustment for the value of your time. You can also take a cost basis adjustment for certain closing costs as described in publication 523. Your capital gain is the difference between the selling price and your adjusted basis, and you will be taxed on it at ordinary income tax rates.
The home is more complicated, although all the rules are covered in publication 523. Your capital gain is figured the same way—selling price minus adjusted basis, and you can take the same basis adjustments for permanent improvements and certain closing costs. (However, your improvement must still be part of the property. If you replaced the furnace in 2000 and again in 2020, only the cost of the furnace in 2020 counts as an adjustment to cost basis.). Then, if the home was ever a rental or for business (home office, home day care, etc.), your adjusted basis is reduced by depreciation you took or could have taken.
Then, if you lived in the home as your main home for at least 2 of the 5 years prior to the sale, you can exclude the first $250,000 of capital gains from tax, or $500,000 if you are married filing jointly. Any capital gain more than your exclusion is taxed as a long term capital gain, which has reduced rates compared to short term gains. If the home was used for business or rental, the depreciation you took has to be "recaptured"--that means paying tax on the portion of the gain due to depreciation at recapture rates, which are regular tax rates but capped at 25%. https://www.irs.gov/pub/irs-pdf/p523.pdf
As far as I know, Massachusetts does not have a special capital gains tax rate, so any taxable gain (the gain on the flip and the non-excludable part of the gain on the home) will be taxed at ordinary income on your state return.