Cats are an interesting animal that must be given respect. You cannot force a cat to comply with your rules like other animals and in fact trying to do so will yield in aggressive cat behavior. If a cat thinks it is cornered or you are trying to force it to do something it doesn’t want to do, it will either run away or go into a defensive position (if it thinks it cannot get away). You don’t want to touch or try to pick up a frightened cat, that would be a mistake you will regret with painful cuts that will ensue when the cat starts to slice you with his claws both hands and feet.
A cat demands respect and there are ways to give it such respect while still demanding that the cat behaves a certain way. You have to approach a cat with diplomacy and tact. A cat that respects you and has a rapport with you tends to listen better but you will have to make the cat think that it’s decisions are his (or her) own. You can find manuals on cat training that will show you a glimpse into the cat world, the cat psychology, so you understand the foundation of how a cat acts and reacts.
Knowing what works and what will become counter productive is key to training a cat to behave. Often a cat becomes aggressive due to being abused in the past, or people scaring it. Cats have a good memory and associate behavior of other people to new people until it has a chance to get to know the new people and realize they mean it no harm. Aggressive behavior is not always there to prove dominance or testosterone, it is more often than not a protective mechanism and it can be deactivated by simply respecting the cats space and giving him a chance to come around.
Patience is a virtue in this situation but you can not just ignore the cat and expect it to come around completely on its own. You want to communicate with the cat, place desirable food close to him but do not chase him into the pantry or force him to come out. Patience and time are needed and putting yourself in front of the cat from a distance will forge a relationship with the cat. In time the cat will come to trust you and will build a relationship with you.
Just because the cat is laying down right in front of you doesn’t necessarily mean it wants or will let you pet it yet. Moving in close slowly like putting your hand near him and gauging his reaction is essential. Once he lets you pet him pet him for a moment then draw back slowly increasing the time you pet him each time. Once a cat fully trusts you then there are additional ways to train him to behave in your space.