There are so many things wrong with your code:
You've created a class Balls, which should contain some variables and methods, but you've added a struct UserView inside. This struct should be outside of the class, at the same level as the class.
Your #Preview should be at the root level, just like the class and the struct.
for item in Balls is completely wrong for two reasons. Firstly, you're trying to access the class Balls not an instance of it, and secondly inside a View you have to use forEach, i.e. balls.forEach { item in.
On line 57 you commented out //var balls [Int] = [ball1; ball2; ball3]. This syntax is wrong. You're missing a colon before the [Int] and you have to use commas not semicolons to separate items in an array, i.e. //var balls: [Int] = [ball1, ball2, ball3]. But, even then this is wrong because you're trying to create an array of Ints but you're passing in three objects which are of the type Balls.
I think you need to go back to the beginning and look at how to write Swift and SwiftUI code. There are so many issues in your code here.
I note, right at the top, on line 4, you've got a comment: Bouncing Balls Simulation without ChatGPT's Code. I fear you've attempted to use ChatGPT to write code for you. Please stop doing this. Learn how to write code properly. ChatGPT won't help you, and it has clearly led you down the wrong path.
There are loads of resources to learn Swift. Apple provides tons of sample code that you can read, follow along with, and learn without resorting to unproven, dodgy 'AI'.