I've given 2.
Keep it short, keep it sweet, keep it funny but not insulting. Compliment the bride in some way, even if you hate her. And if you don't know her that well, then say something to the effect that you can't wait to get to know her better.
The first one I thought up on the spot and went into unrehearsed, but I'm good at doing things like that. This one turned out more 'sweet' and produced the most crybabies in the audience, but I knew the couple very well.
The second I wrote out and practiced. I knew the groom for 15 years, but didn't know the bride very well. This one was more comedy focused purely because of how we grew up together. His mom came up to me afterwards and told me I could have been absolutely mean with that speech, but thanked me for keeping it tasteful and memorable.
If you have funny material, be aware of the backstory of people's families. Things you and the groom may have found funny through your years together, other people may find incredibly insulting. I had a 'bit' that I had to eliminate on the spot to prevent looking like an asshole due to things I witnessed while just looking around at the guests there. Any other day it would have been funny. But due to some attendees, it would have been tasteless.
Make sure to take note if the audience even has glasses in their hands or not. If it's just a speech, then end it with best wishes. If it's a toast, then end it with the whole "so raise your glass..." etc ending.
If you're not a public speaker, then try your best not to get nervous. Just think of it as a formal conversation with your friend and his new wife. Forget everyone else as best you can , but try your best to be aware of them and be sure to pause a bit for laughter. Also speak up. Everyone hates a speech they can't hear. Then above all stand up straight and deliver with confidence.
Sadly no one is going to remember your speech, especially not your friend, but you will. I don't remember the speeches that were given at my wedding, but I do remember to this day the exact words I said at my friends' weddings. So it will be something you live with, even if it isn't something they live with
No pressure... good luck.