I never advocate for burning bridges, but it can be wise to keep things in perspective. At the end of the day, you have to do what's best for you and your career. It's a job that pays the bills so that you can live your life, and if the company had to downsize, no one in HR would think twice about making you redundant if you were put on a redundancy list by your management. It's just business.
Once you're ready to hand in your notice, give notice, but make it clear that you're ready to move on (I don't think that counteroffers are generally viable or worth it from an employer or employee perspective). I generally adopt a "it's not you, it's me" attitude to these things, even if it is 100% them. Nothing good comes from burning bridges. "Thank you for the opportunity to work at the company, I have enjoyed working here, and it's now time for me to move on. I will do my best to ensure a diligent hand-off of any information that the company may need from me before I leave on [x date]."