There are many different forms and disciplines of martial art. So before you start taking classes you need to research which one you want to do.
To begin with I would advise taking some beginner classes in a handful of different martial arts to find out which one you like the best. It also helps you to become better at your chosen martial art if you have knowledge of other disciplines.
When taking classes I would advise joining your local club for your chosen martial art. Many leisure and fitness complexes hold classes but attending these can be more expensive than finding your nearest club.
Once you have found the martial art you like the most you will need to invest in the proper attire. This can be expensive but if you are part of a club they may be able to get it for you at a discount.
To study any martial art you need to be fit so alongside going to classes you need to implement a fitness regime.
One thing you should never do is practice or use any of your moves against anyone outside of your lessons. You can practice the motions and techniques outside of the classes by yourself though which should help your development.
Most martial arts will have a grading system which grades which level you are at. To get a grading you will need to demonstrate a certain standard either within your lessons or at a public event. You should be always aiming towards your next grading as that is how you improve.
Once you feel confident start entering in to competitions. Many clubs will have in house bouts and competitions which is a good way of seeing if you are ready for entering tournaments.
Try and compete against as many different people as possible as the more people you compete against the more you will learn.
When you are at a competition regardless if you have been knocked out first round wait around and watch the rest of the tournament and see how the other people are winning their bouts.
Some martial arts require a level of flexibility. If you aren't a very flexible person look at things like yoga and start doing exercises by yourself to improve this.
The thing with martial arts to remember is to keep focused and determined.