Learning to sew on a machine is a difficult but doable task. Sometimes you need someone to help you, often you can do it without. The best way is to do the right things and start in stages, for example:
1-Buy the right sewing machine.
Unless you want to hand sew all the time, a sewing machine is necessary.
If you have an old one that your mother, grandmother or aunt left you, that's fine. Sewing machines from the past, if properly cared for, sew beautifully.
If you have to buy it instead, you can choose a used model, provided it is in good condition, or a new one, provided it suits you. If you are a beginner, I would recommend a simple, but at the same time solid and stable sewing machine that will last you for years. I would avoid the toy-like pocket sewing machines, but also the super-fast machines that make a thousand squiggles: to start with, a machine that does linear stitch and zig zag is more than enough to sew anything you want.
2-Read the instruction manual carefully
I don't know why, but it's common for instruction manuals to almost never be looked at.
On the contrary, they are very useful, especially for those who are starting to sew on the machine, because they explain more than you can imagine.
Some of them are very well done, and in addition to explaining how your pattern works and what stitches it does, they often have lots of suggestions and tips for learning to sew (for example, I know some of the old Singer manuals are really well done: they have lots of step-by-step explanations and are full of pictures).
In any case, I suggest that whatever your instruction booklet is, always keep it handy: you will learn to know your machine and you will avoid damaging it by bad maneuvers.
3-Search for online resources
The web is full of tutorials and videos that explain how to sew and do everything from threading the machine to cleaning and maintenance, from attaching a button to making a garment you can wear.
If you are in doubt, do a web search: you will probably find what you are looking for.
5-Ask for help
If you have any doubts and you are lucky enough to have someone you know who can sew, don't be ashamed and ask them to teach you (I used to do this with my mom and now with my cousin).
Invite her into your home, offer her a cup of coffee, and while you're giving her a taste of your pie, ask her, "Since you're here... can you show me how to sew a zipper?
6-Register for a forum
If you don't have your mother, a neighbor or a trusted seamstress to turn to for advice, join an online sewing community. There are many forums or groups on the net that you can join to get support, ask questions, share your results. The answers and encouragement you receive from fellow sewing enthusiasts will make everything easier and more fun, not only in the beginning, but when you get there.