Thank you for the answer!
however, it seems as if nothing’s changed. When I put https://www.mydomain.cz in the address bar I am redirected to mydomain.cz
My goal was to do that the other way round. Anyway, I tried to tweak your code by switching Condition and Rule
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
Didn’t work either.