Don't tell her off or smack her when she makes a mistake. Gently sit her on a clean tray (cats hate dirty litter) and tenderly press her bottom onto the litter, telling her how good she is, then scratch at the litter with your finger. When you let her go, she'll jump out, but if you keep doing this, patiently, then she'll learn that this is where you want her to go. Cats are intelligent animals, and quick learners, but they don't learn by ordering, but by coaxing.
Good luck.