How can I make tabs to open/close by a click?

Common question
Working with blocks
Appearance
Payment
Teams
Statistics
Security
Affiliate program
Advanced settings
Layout
Interface

You should use a "Tab Type" - "Accordion", as shown in the image below.