@Kim Burata You can refer to the create variables for saving document on the usage and how you can use different variable actions. Depending on your requirement you can either initialize individual variable or initialize as an array.
Assuming the space that you are talking about is the JSON content generated in the code view of your logic app then based on your requirement if defining array variable helps you then you can use it else you can define as individual variable. The suggestion is only define the variable that are used later in your workflow else the unused variable that are define as part of action will still be treated as individual action in your pricing.
As logic app is charged based on the number of actions for consumption plan and if you initialize different variable (i.e. action) and set the value later on then every action will be counted for the pricing.