you get flexible by riding in the drops and by riding more, and especially by having a good stretch after your ride.
doing this and nothing else, I went from being unable to touch my toes-- probably 1.5" from it-- to easily touching the floor. can't quite get my palms flat on the ground yet but I'd give it a year.
you can also do yoga. I did for a little bit, because my wife is very into yoga. I quickly concluded it wasn't my strong suit.

I did not stick with it long enough to gain any benefits, so as I said, I gained a lot of flexibility from riding and normal stretching. stretch after a ride, not before unless you keep it real easy and short. warm up by riding slowly instead.
on the bike I went from 30mm of spacers (yes) on a 90mm +6deg stem to no spacers on a 110mm -6deg stem. I did not do this for vanity. I started to feel cramped on the bike, and I went longer and lower quite naturally.
do not move your seat to adjust your reach. that will seriously screw up your knees, sooner or later.