I'm not a lawyer, so I'm definitely not your lawyer
If you have legal questions about licensing, no answer the folks here on Hashnode (or anywhere online) will be better than if you speak to a lawyer and explain what you're planning to do. The MIT license is short and not very tricky to understand, you should be able to get an opinion from a real lawyer that you can have confidence in!
I'll do my best here as a non-lawyer to try to clear up some questions you might have.
Copyright <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from: opensource.org/licenses/MIT
Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. There are many variations of this license in use.
from: tldrlegal.com/license/mit-license
Based on the license text itself, and the TLDRlegal.com explanation of the freedoms, restrictions, and obligations, it seems like you should be free to:
As long as you:
The way the license reads, it doesn't appear that your derivative work (your product based on the MIT-licensed code) must be released as open-source. MIT is a very permissive license that gives you a lot of freedom, you may be totally within your rights to include MIT-licensed code in a non-open-source product as well.
Personally, I choose to license all of my own open-source software as MIT because I hope it's permissible enough that anybody who ever wants to use my code in any product has an easy way they can use it while being sure they aren't breaking any rules :D