How to constraint a position inside of a part

Hello
I want to know how to constrain a position inside of a part regarding of the rotation and size.
I’ve struggled with this in the past and i just wanna learn it tbh.