How do I link each user to their data in xcode

so i wanted to ask how do i link my users to their specific data in my Xcode app because right now everything is public so every user can see the same thing but i want that user to have his own data eg(for my app ,users should be bale to access their card collection which is different from the other persons) Is there anyone who can walk me through it