Open source is great because it gets you access to a wide types of participation on a wide range of subjects.
Want to test? Fix bugs? Develop New features? Try a new language? Manage a project? Start a new project, from scratch? Write documentation? It's all possible. And as you're finding, it can be overwhelming to know how to participate, because you don't have a boss telling you what to do - instead, you essentially have a long list of opportunities and you need to pick where/how to start.
Most open source projects are hosted on a public repository, ie github. Most projects include instructions on how to contribute (although sometimes they're not obvious) or at least names/contact info for people involved in the project. Most people who participate in Open Source are doing so because they want to foster the community of Open Source contributors, so they're often more than happy to help newbies.
Find some (active!) projects you're interested in, contact those already active, and ask the best way to get involved. Likely, as a newcomer, you'll be directed to work on bugs from an issues log, so pick those that look easiest to you. As a newcomer, it's sometimes hard to get real experience on a project that has no one else working on it, so if a project doesn't seem to be getting attention, look for something else.
Before you contribute, it may be useful to watch a project for a few days/weeks to get an idea for the cadence and habits of those working on it. When others check code in, look at specifically what they did and use it as a learning tool.
Consider this as much an exercise in learning to work on a team, and learning to contribute to a group, as it is an exercise in writing code. Which leads me to your comment:
However, I thought maybe it is better to have experience dealing with open-source projects before diving in to a real world project, to improve my self-confidence and decrease the risks!
It's worth noting that Open Source doesn't mean "isn't real." It doesn't even mean "has no economic impact." Lots of open source projects have plenty of "real" implications in terms of powering millions of dollars of economic activity and impacting every day lives. The good news is, you can get involved in this massive engine and make a difference, without first having to get hired by a specific employer. So - don't look at it as "not real" or "low risk" - instead, look at it as a learning opportunity and the chance to make a difference, outside of your paycheck.