Inheriting securities

If I inherit securities , how is the cost basis determined?
Do I owe any federal taxes on the security?  Or do I pay the taxes ONLY when I sell the security?

For example: On 6/6/2022 I inherited 100 shares of TSLA.  If TSLA was trading at $75 on 6/6/2022, do I owe taxes on $7500 if I still hold the shares?  If I sell TSLA on 9/1/2022 at say $100 per share, do I owe taxes on $10,000 - 7500 or $2500 OR do I owe taxes on the full $10,000?