How to keep shape edge while we smooth or mask in 2.9.21?

How to keep shape edge while we smooth or mask in 2.9.21?