Nowadays there are many direct flight from Europe which can cost you under 200 dollars return. Those flights can take only about three four hours. You can try connections from London, Amsterdam or Lisboa. But there are many more cities you can fly to Madeira. See them all here.
My go to website to find the cheapest flights possible is Momondo, so definitely check that one first and go from there. If you have any doubts and questions about how to reach Madeira, feel free to send me a message and I'll be happy to help you.
If you can, I would recommend you to stay at least 10 days! And if you have three weeks, then fine, take it slowly and soak all the relaxing vibes in!
I know, I know, Madeira seems like a tiny island, so you are probably asking now, holly molly, what would I do there for three weeks?! But trust me, there are so many hikes, adventures, culture, and beautiful viewpoints to enjoy, that you will be thanking me for those three weeks :)