"I need a horse."
Translation:Ich brauche ein Pferd.
You are perfectly correct, that the definite article 'ein'/'a' takes the form 'einen' when used for a masculine noun in the accusative. Pferd is, however, a neutral noun, so the article 'ein' stays the same, in the accusative. Unfortunately, while there are some clues as to the gender of many nouns, for the most part, you simply have to try and learn and remember the gender of the noun. Stay with it!