They can be two ways of achieving the same thing, and you won’t find it intuitively clear when you should pick one over the other until you learn to do both. Texture painting is great for total artistic freedom but can be limited by the texture resolution and UV unwrapping, while the shader editor procedural textures are great for repeating patterns that don’t depend on UV’s. I’d say start with texture painting if you’re unsure and go from there.