Your chances of infecting your fish from plants are far smaller than if you introduce new fish to your aquarium. As far as ensuring the health of the plants themselves, you want to look for leaves that are free of holes, and not yellow or decaying. Preferably they should also be free of algae. Of course, just like buying terrestrial plants at your local nursery, you're bound to have leaves in various states on a single plant. As long as your aquarium conditions are suitable, you'll often be able to resuscitate a plant that's suffered subpar conditions from nursery to fish store to your home. This is not an uncommon requirement, unfortunately.
If you are really paranoid about introducing things into your aquarium, you can quarantine your plants in a separate aquarium for a few weeks prior to adding them into your main one. Additionally, you can rinse/dip most plants briefly in hydrogen peroxide from your local drug store. If the plant is already weak, however, you run the risk of killing the plant.
Personally, unless it's a plant collected in the wild, I don't bother with any of these things.
To answer your other questions:
1. Java Fern can be tied to rocks or wood with black cotton thread. The thread will dissolve by the time the plant has attached itself to the rock/wood.
2. There are tons of substrates to choose from. I suggest you research your options. Locally, Eco Complete and Flourite are easily obtained, and are good substrates. More expensive brands are available online like ADA Aquasoil. Other folks DIY their substrate using mineralized topsoil, capped with an inert sand to prevent the rich nutrients in topsoil from leaking out into the water column. If you're just starting out, you'll do great with any of the Flourite products. Under your sword plant, stick a Seachem Flourish Root Tab, and it'll be very happy.
Good luck!