First you would need to know what scripting language you are going to be using for it. Most places will offer one of PHP, ASP or ASP.NET. Each of them will have a slightly different way of handling it, however the basic theory is the same for each.
1. Create a HTML form for the user to enter their details for registration
2. create a script page for the form to submit to, this page should take the uses details and save them to a datasource (typically a database of some kind, such as Access or MySQL)
3. When the user then logs in (again use a HTML for to create the login box, and a script page that will check their username and password against the database), you will then need to set Session variables that will allow you to track that the user is logged in. Session variables are connected to the visitor and last long enough to that they remain valid for each page the user loads.
Alternatively, if you just want to have a forum, try downloading a prebuilt one from somewhere,
www.snitz.com has a forum for ASP based hosting, while there are various ones available for PHP hosting.