It’s a good idea to always practice trying to keep fingers out of the way of other strings, but sometimes it’s close to impossible. This is where muting and damping comes in to avoid unwanted noise.
There’s no standard way of doing this but we use our fingers and / or thumb on the fretting hand to lightly rest on the strings we don’t want sounding. This way we can still strum across them or accidentally hit them without them ringing.
For the right hand we might use part of our palm or possibly fingers in some instances. Obviously that won’t work if we are floating our hand or strumming. Most damping is done with the fretting hand.
This is very difficult to explain in text, the best thing is to have a look on Youtube, I’m sure there will be plenty of lessons that explain this – much better if you can see it in action.