How to get the balance of stellar

Can you give an example?
I tried many times by myself and couldn’t find a suitable method.

For this you will need to use the transfers api and do the calculations after the query!