If you create proper conditions for a cat it can learn to use a litter box very quick. Hygiene in cats is a natural instinct taught by mother. That is why in 6th week of age kittens are able to care for the bed or the stool is carefully buried in litter box. If the cat does not want to use litter box, you may try to figure why and try to find the source of it.
Are you sure the litter box is correctly placed in a proper place? If yes then we may exclude those factors as a reason for the cat does not want to use it. Firstly you should consider if a cat is not sick so you should take the cat to a veterinarian .if a cat does his things outside the litter box it may tell us he is diabetic, or suffers for some kind of a urologic, a kidney disease, leukemia, FIP, FIV, enteritis, epilepsy, constipation, warms, spine degeneration, joints, or hormone changes connected with maturing or estrus.
When all those sypthoms are rejected by the veterianiran it is worth to think over the behaviour of the animal. Sometimes cat rejects litter box due to stress. Such a situation may take place after changes like change of feeding time, stress can be caused by a change of the food, bowl, refit at home, a now animal at the house, a child or other person.
Another reason may be some bad memories, which may be associated with the experience of aggression, when attacked by another cat or when a man badly handled the animal. The memory remains even catching and gripping the cat to pass a drug or collect urine for test, as well as various penalties, including those that are associated directly with the litter box. In such a situation it would worth to take care of the new litter box, as well as of a new place for it. In addition, you should do everything the cat does not store in its memory any negative events. There are several methods of such.
To change this, forst of all you should provide the cat with a feeling of safety meaning a lot of love and patience. It is worth to think of what to do to stop a cat from not using the litter box. You may spray those places with a repelent or a smell remover. You may cover this areas with plastic or aluminium foil, place a piece of furniture or restrict the access.
You may also place a litter box where cat is doing his things are move it systematically inch by inch to a place where you want it to be. If all the actions fail, we need to limit the cat's territory to one room, when he starts to get used to the litter box we have to reward him and gradually extend his territory.