First get to know your horse because, you two are basically strangers. So what you do first is you reach out with your hand and make sure your hand is flat, and let your horse smell your hand. Make sure he\she knows that you aren't a threat, that is really important for your horse to know. after that you need to pet him and make sure that he/she knows that you are the boss. If you don't establish that early on he/she will take advantage of that and start bossing you around instead. Also make sure that you spend a lot of time with your horse so that way you can form a bond with him/her. To assert you dominanice you need to tack him/her up and then start riding. If he/she acts up the give the reins a nice tug, but not to hard. If he/she keeps doing it then talk to a profesional because he/she might have something more problems than just behavior flaws.

Try to guess who is the leader of this herd of horses (I will tell you how to find the leader of a herd of horses later).

Here's how to find who is the leader of a herd of horses.