You can clean inside the calipers as part of a general bike wash if you take the wheels out. It’s best to put the bike in a repair stand or find some other method for suspending it above the ground. As you wash the bike wash around the calipers. You can thread a clean rag between the pads and use a ‘flossing’ action to clean between the pads. But very careful to not pull the brake levers when you are doing this as the caliper pistons and pads would be over-extended, and you will not be able to get the wheel and rotor back in the fork or frame.
When cleaning, make sure you thoroughly wash off any detergent or cleaning product that might act as a lubricant on the pad or rotor.
If you want to be a bit more thorough, you can remove the pads and push the pistons back into the caliper. This will give you more space to clean in inside the caliper with a rage or small brush. Again, do not pull the brake levers. With the pads out the pistons can over-extend and may come out of the caliper. If this happens you’ll need to have the calipers rebuilt and bled. How the pads come out is dependent on the caliper model but generally you undo a retaining bolt, then the pads slide out of the top of the caliper. Check the model of your brakes and look up the manual to find out how to remove the pads. Do not try undoing random bolts on the caliper. You also want to make sure you know how to re-install the pads properly, for obvious reasons.
In some cases the pistons can get sticky in their seals. There are special cleaning methods to address this. See this Park Repair Help video