If you want to prevent your cat from going upstairs, here are some suggestions:

Door latches or doorstops: Use door latches or doorstops to prevent cats from entering or going upstairs. Ensure that the latches or doorstops are secure and cannot be pushed or jumped over by the cat.
Targeted training: Teach your cat not to go upstairs. Use positive reinforcement methods, such as giving rewards and praise, to encourage your cat to stay in the designated area and not go upstairs.
Enclosed staircases: If possible, consider enclosing the staircases to prevent cats from accessing the upstairs area. However, ensure that the enclosure measures are safe and secure and will not pose a danger to the cat.
Increase the appeal of other areas: Create an attractive area for your cat, providing a comfortable bed, toys, a cat tree, and activities and entertainment that your cat enjoys. This may encourage your cat to stay in that area instead of going upstairs.