First, choose a location in your bathroom where you will install the cabinet. For example, you can make a cabinet near the sink to place stuff like tooth brushes, shaving gel, medicines etc. or at the vanity area where you can put some other stuff in it.
The second step is to measure the space in order to ascertain the dimensions of the cabinet. If you are low on width, you can design a tall cabinet and if width is not an issue, you can reduce the height to create a shelf on top of the cabinet.
If you are going to be placing towels and undergarments in your bathroom closet, you will need to account for them and create more space. You can do so by either increasing the height of the cabinet or its width. However, is it not recommended that you install a closet near the bathroom floor, because water will ruin the wood.
The opening mechanism of your closet is also important in order to save space. If you go for small door-like panels, you will have to account for more space in the front to comfortably open the cabinet. However, if you are low on space, you can opt for sliding doors which allow for easy access.