With the exception of certain kinds of retirement accounts, investment gains are taxable. In other words, if you buy $100,000 worth of stock and sell it for $120,000, you owe taxes on the $20000 gains, not on the original $100000.
In 2023, individual filers won't pay any capital gains tax if their total US taxable income is $44,625 or less, so if it was just that $20000 profit you wouldn't owe any taxes. In the next bracket, up to just short of a half million dollars, the rate is 15%. If your income is above $492,300, capital gains are taxed at 20%. So worst case, the taxes you would owe would be 1/5th of your gains, not 1/4 of the total.
Starting a loan with most of the payment being interest is entirely normal; that's how the amortization formula works out when you want to make equal payments over the life of the loan. See other answers about how loan amortization works. So the fact that 75% of your loan payment is interest is not something to panic about; that percentage will drop over the course of the loan until the last few payments are almost entirely principal. It does NOT mean you are paying more on the loan than the interest rate you signed up for.
Deciding whether to use investments to pay off a loan is a matter of comparing the interest rate of the loan against the rate of growth (after fees and taxes) you are confident you can get from the investments. If you believe that your investments are very likely to grow at 8%, and your loan is charging you 6%, you may want to leave some or all of the money in the investments; this is essentially a form of leveraged investment. If the numbers are the other way around, it may indeed make sense to use the investments to pay off some or all of the loan. That's a decision you need to make based on your own finances and risk tolerance and confidence in the market.
In my case, my original mortgage was at 6.5%, and 8% is considered "typical market rate of return". I could have sold off the investments and paid cash for the house instead. Or I could have borrowed the entire thing. Instead, I was most comfortable with a compromise between the two options, cashing out about half my investments to pay about half the value of the house, and taking a mortgage for the rest. Whether that strategy will make sense for you or not is something you need to determine for yourself.
EDIT: I should have mentioned that the other obvious way to reduce the cost of the loan is to see if you can refinance at a lower rate. As I said, I bought the house using a 6% loan. I refinanced it twice, taking new loans at lower rates to fully pay off the previous loan, and because the economy was being weird in the right direction I was able to negotiate that down to 3.25%. There are some fees associated with refinancing, but rule of thumb is that if the loan has a while to go and you can reduce the rate by a full percentage point or more, it's worth doing. You aren't necessarily stuck with your initial mortgage forever, at least not in the economic systems I'm familiar with.