I installed something
What you installed may be able to see what you type. These steps cut it off, most urgent first.
Disconnect from the internet.
Turn off Wi-Fi and mobile data, or unplug the internet cable. Phone calls still work. Reading this on that device? Read all the steps first, or open them on another device.
Delete what you installed.
On a phone, remove the app; on a computer, uninstall the program. Remote-access apps like AnyDesk or TeamViewer count too. Won't delete? Keep it offline and have it checked.
Call your bank now.
Use the number on your card. Tell them someone could see or use your phone or computer, and ask them to lock your online banking and watch for payments you didn't make.
Work account or work device?
Tell IT now: they can lock it and check what was reached.
Change your passwords, your email first.
Whoever got in may have seen what you typed. Use another phone or computer if you have one; if not, wait until it's been checked or reset.
Have the device checked.
Ask someone you trust, or a repair shop, to check it before you use it for banking again. If they can't be sure it's clean, they can reset it to how it came from the shop.
Report it.
Report it to your police or your country's fraud reporting service, even if you lost nothing. Reports help stop the same scam reaching others. Add your screenshot of the message, if you took one.
From now on
Watch for the next message or call.
Scammers often come back with a more convincing one, sometimes pretending to be your bank or the police. Check it here before you act.