How to toggle class inside a specific child element when the parent element is clicked using vanilla javascript?

When a parent button is clicked, a class is toggled inside its child element to show or hide and when that child element is clicked it will display a loading animation for few seconds and toggle back the child element to it’s original state which is hidden.

I tried to add follow the pure vanilla JS but couldn’t get it to work properly. I have done the adding show class when the parent class is clicked but the loading animation is where I got stucked.