Sample account is used to create similar A/c in SAP with defined control procedure. This is basically to set a standard for similar kind of A/c to avoid error and problems in future. In the first step you maintain sample account rules variant.
Maintain sample A/c rule types
To create it you can use transaction code OB15 or following path;
SPRO > Financial Accounting > General Ledger Accounting > G/L Accounts > Master Data > Master Data > Preparations > Additional activities > sample accounts > Maintain list of rule types
The next step after setting the rule is to set the data transfer rules. To set it for your sample A/c please use following path;
Same path is above and then select: Define Data transfer Rules
You can also use transaction code FSK2 to create it.
Allocate company code to Rule types
Use transaction code OB67 or following path to assign company code to rule types;
SPRO > Financial Accounting > General Ledger A/c > G/L Accounts > Master Data > Master Data > Preparations > Additional activities > sample accounts > Allocate Company Code to a rule type
Now your company code is assigned to the rules. This will provide you uniformity in creation of general ledger A/c.
Create Sample A/c
To create it you use path: SPRO > Financial A/c > General Ledger A/c > G/L Accounts > Master Data > Master Data > Preparations > Additional activities > sample accounts > Create sample accounts
You can also use transaction code FSM1
While creating general ledger A/c you use the sample A/c as a reference and create with reference to it. If you want you can change the settings of sample A/c. But you need to create is as per the business requirement.