Reuse codes from a plugin in my WordPress theme

My english is very poor, I’m creating a theme for wordpress and I work with plugins, I could indicate how to reuse a file or part of code of a plugin and put it in the directory of my theme so it does not affect the updates of the plugin.