Once you've warmed the audience up with the funny stuff, it's time to get a little sentimental. You don't need to overdo it here -- a few heartfelt words to the happy couple can accomplish more than rambling, repetitive gushing ever will. I'm not going to explain to you how to have feelings (unless you're an alien robot sent here to learn our Earthly customs but then OH WHAT HAVE I DONE?!) -- but hopefully if you've been placed in this position you are truly happy for your friend/family member and the love they have found. So yeah, use that.
One critical element that must be in said poignant ending -- you must say some nice things specifically directed at the other person. If you are the best man this means a few meaningful and well-chosen words about the bride that go beyond "you look beautiful tonight." although you should probably not skip that obligatory compliment, either.
A note on crying: in case you haven't heard, some people get emotional at weddings. This is OK! If you're overcome by the moment and happen to tear up a little bit it adds a dose of gravitas to the occasion. Just tried to avoid turning into a blubbering mess who can't get two words out, which makes it weird for everyone. Luckily, if you follow this plan, you don't have all that many words to get out, which brings us to rule number three.
Keep it short
You are not the star here. The function of the toast is for you to honor the couple you're celebrating, not turn the thing into a multimedia one-man show. Even if you happen to be a funny, engaging public speaker, doing some self-editing and paring it down to a few really thoughtful minutes is a much more effective way to convey your feelings than a self-indulgent spectacle that drags on and on.
And if this whole "speech" thing terrifies you and you think you are terrible at public speaking? Look, there's a chance you actually aren't good at this! But if you keep it fairly brief, the extent to which you can really screw up is substantially minimized, as no one will be dwelling on how long you kept them from the bar.
Note: none of this applies to fathers of the bride and other parental speeches -- they raised a damn kid and are likely footing at least some of the bill for this thing, so they may indulge themselves as they see fit (though, parents -- if you wanna stick to this approach, it's a real winner!).
There are some other housekeeping-type tips that'll help make your speech more polished. Index cards look much cleaner than paper, though you should be familiar enough with your blessedly short remarks that the cards are there mainly for the occasional backup glance (winging it is not advisable -- you're actually MORE likely to talk forever if you haven't planned anything).
Also I've personally found that two pre-speech drinks (if you're of roughly normal boozer tolerance) will land you in that sweet spot between "overly nervous" and "using the mic stand to prop yourself up."
But these are all next-level details. If you stick to the big three -- funny, poignant, short -- you'll just about ensure that you won't be the one to screw up the wedding, or at least not via your speech. What happens on the dance floor is up to you.