How do I get to know/work with academics during my master's degree?
Since you appear to be in Italy – actually a fellow citizen! – I'll try to give an answer from an Italian perspective. As a master's student, you usually have three possibilities to work with professors:


start working on your master's thesis;
apply for a teaching assistant position for one of the classes;
do an internship.


For what concerns possibilities 2 and 3, these may be available or not depending on university, field, year etc. For instance, I have TAs from both bachelor's and master's levels and I'd be happy to provide recommendation letters for them, as I did for others in the past.

If none of the above work for you, you can try asking professors whose classes you attended, getting top grades. In this case, however, they might not be willing to provide a recommendation letter. In fact, up to a few years ago, I wasn't willing either, as I explained in this answer. Nowadays, I accept (even though I don't approve of this practice) that recommendation letters are required almost everywhere, and I'm more willing to provide recommendation letters to students who attended my classes and somehow positively caught my attention (at the exam, through in-class questions, during office hours).