Cantrips can ran out? Its not unlimited? [closed]

I thought cantrips can be used unlimited? Why during battle it ran out? My wizard dont have any spells to use anymore in long battles and becomes useless.

So whats the diff then with cantrips with prepared spells?

Firebolt cantrip for ex.

P.S. New to baldur’s gate 3 and D & D in general.