However, if your application has a mainly constant power draw (i.e. IoT sensor waking up and performing work on fixed intervals), you might exploit this to have fun implementing a level estimation by yourself, only using the voltage.

https://www.stg-maximintegrated.com/en/design/technical-documents/app-notes/3/3958.htmlTowards the end of the application note you can see that the voltage doesn't relate linearly to the battery charge level. You might profile your battery under your constant load, recording the voltage, to then store the curve and lookup its inverse for finding the current capacity. Then, as a next step, you might reason about adjusting the curve over time to account for battery aging and degradation. A simple idea could be, knowing that your load in Ampere is constant, to integrate the estimated consumption on each 100%-0% cycle and keep track of how the total capacity is decreasing, then adjust the charge estimate proportionally.

Of course a battery monitor/gauge is the best solution as suggested by the other members. I just wanted to give my 2 cents on how I would approach this if I were to force myself, of be forced, not to use it. A solution like this will for sure be less accurate, but for a hobby project I think it would be fun to implement something like it.