Starting freelancing (L permit to B permit)

Hello! I am from an EU country working in Switzerland on a L-permit until end of April 2022. I would like to start freelancing and stay here long-term when the job I originally came for ends.

I have found 3 clients who are interested in working with me, so my question is what do I have to do that my freelancing would be legal?

Register as a self-employed / einzelfirma and then contact my gemeinde to change the permit to B or first try to change the permit and then register the einzelfirma? or does this process go hand in hand?

I have read what they write on the official sites and hoping for the advice of somebody who has practical experience or knowledge.

Please search EF for “freelancing” - this has been covered many times here...