How to send email to user when we change his group? I have some user groups with different permission and I need to notify them by email when i switch them to another group.

Is there a way to make it automatic by a plugin or via the code directly?
With a plugin, you can tie into the userGroups.onAssignUserToGroups event and send your update email directly with the details.

https://craftcms.com/docs/plugins/events-reference#userGroups-onAssignUserToGroups