IFRAMES:
You would typically use an iframe when you want to embed a custom UI/form/control. You mention custom buttons, so this is likely what you want to use.
Iframes can be embedded in your form in 2 ways: through adding an iframe component on your form and specifying the URL or adding a web resource to your form, which can point to a custom html page that you can add through CRM customizations. The second method is likely the one that fits what you are trying to do.
You can then add various types of functionality through the page that updates data through calling the SOAP or REST API's that CRM exposes. You will likely want to check out the CRM SDK.
Form scripts:
Form scripting can be used to manipulate data, requirement of fields, showing/hiding of controls or sections, etc.
Ribbon Buttons:
Another thing to mention is that ribbon buttons are often the best way to add functionality like you are describing to your form. More info here.
I hope this has been helpful.