IMPORTANT: The company you work for is not your family, you don't owe your job anything beyond the work you're being paid for.
Prioritize your own growth and well-being over misplaced loyalty, and don't ever feel guilty about leaving a job.
Companies are not families, they're businesses, it's a business relationship and their primary goal is to make money. If they can make more money by laying you off, they will without hesitation.
If you have an opportunity to better yourself, don't feel guilty about taking it.