When you sell a call option you either need a margin agreement with your broker sufficient to cover the assigned stock or you hold the applicable shares and they are collateral to the option. In your situation, your shares are the collateral.
So if you don't want your shares to be assigned you either need to buy back the option while it's out of the money or get the option approval to cover your collateral requirement with margin from your broker.
I'm going to add a bit to avoid spending the rest of my life in the comments.
I asked myself this same question a while back because I was curious to generate some revenue from my existing holdings but one such holding has a gain of 3,000%, so any assignment would generate a tax bill. Since I otherwise had no desire to sell the stock, the answer is don't sell a call on that stock, because the alternative was get approval from my broker to sell naked options and open a margin line using a bunch of other assets as collateral and open myself to way more risk than the potential tax bill.
When you sell a call, you are selling the right to buy a stock. Which means you NEED to be able to produce the shares related to the contract. You, the seller, make money if the stock doesn't rise above your strike price. If the stock does rise above your strike price, your stock is sold at the strike price, which is below the current market price, that spread represents lost income to you.
The issue with, and why you should never, sell a call option naked (without owning the stock already) is because, as with selling a stock short, your risk is unlimited. Say for example you have 100 shares of XYZ which is trading for $22. You sell a call option with a strike of $25. The price rises to $27, and your stock is assigned so you sell at $25, missing out on that additional $2. If you didn't already own XYZ stock, you would have to buy 100 shares at $27, then sell them for $25, now rather than missing out on $2, you have a loss of $2.
Imagine in some crazy twist of fate you sold a call naked on XYZ and the price of XYZ jumps to $5,000 per share. Assuming your broker hasn't called your margin and stopped the madness, now you'd have to go to the market and buy 100 shares for $500,000 to sell them for $2,500 for a loss of $497,500. If you were covered by shares you already owned, your risk is limited to the price you already paid for the 100 shares, not the current market price.
No one, ever, would ever, ever, choose the above possibility over just letting their shares get assigned. If you don't want your shares to be assigned, don't write calls against your shares. And DEFINITELY, don't sell naked calls, or open naked short positions because you can lose up to infinity dollars. The market can go up to infinity but only down to zero.