Some things that might help.
Instead of a foam in a can, try to use a brush and the cream that comes in a toothpaste like tube.
Always start shaving in a downward (up-down) motion and reapply foam before shaving in other directions.
The longer the beard grows, it's harder to shave.
Shaving must be a slow and even relaxing process. Some people even enjoy it and look forward to it.