Take your ID card and House Registration to the hospital which serves your area and register. Going forward, you will only need to present your ID card. If you are living in Bangkok, you can check the health center which serves your address (it may not necessarily be a "hospital"). For example, the health center serving Sukhumvit 101 was the Wat Thathong Health Center near Ekamai. Up country it is a bit easier as it is going to be pretty much always the nearest government hospital or health center (mine is about 500 meters from my home).
You cannot just walk in to any gov't hospital for care unless it is an emergency such as an accident. If you have a serious issue that your health center can't help with, they will give you a referral to the nearest gov't center that can provide the required treatment. You should not just turn up at a government hospital of "your" choice for the treatment you want, unless you are willing to pay. You should obtain the necessary referral first.