Can someone please explain how to use the AccountManager in app development?

I found several explanations in different sources in the web but I can't figure out how this whole thing works?
Is there a spezial syntax or process order so it works properly?

Thanks in advance
Greetings 
Franz